title: Python dictionary converting to json or yaml
body: <p>I have parsed a string and converted into a dictionary. however I would like to be able to get more information from my dictionary and I was thinking creating a son file or yaml file would be more useful.
  please feel free to comment on another way of solving this problem.</p>
  
  <pre><code>import re
  regex = '(\w+) \[(.*?)\] "(.*?)" (\d+) "(.*?)" "(.*?)"'
  sample2= 'this [condo] "number is" 28 "owned by" "james"'
  patern = '(?P&lt;host&gt;\S+)\s(?P&lt;tipe&gt;\[\w+\])\s(?P&lt;txt&gt;"(.*?))\s(?P&lt;number&gt;\d+)\s(?P&lt;txt1&gt;"\w+\s\w+")\s(?P&lt;owner&gt;"\w+)'
  m =re.match(patern, sample2)
  res = m.groupdict()
  print res
  </code></pre>
  
  <p>and I would get:</p>
  
  <pre><code>{'tipe': '[condo]', 'number': '28', 'host': 'this', 'owner': '"james', 'txt': '"number is"', 'txt1': '"owned by"'}
  </code></pre>
  
  <p>I would like to be able to sort by owner name and write out the type of house and the house number. for example:</p>
  
  <p>James:{ type:condo, number: 28}</p>
  
  <p>or any other suggestions?</p>