title: Converting string to ordered dictionary?
body: <p>I have a string which basically contains a bunch of JSON formatted text that I'd ultimately like to export to Excel in "pretty print" format with the proper indentations for nesting, etc. </p>
  
  <p>It's imperative that the original order of key/values is retained for readability purposes. My thought process to accomplish what I want is to </p>
  
  <p>a) use something like eval to convert the string to a dictionary and
  b) use OrderedDict from the collections library to keep the order intact.</p>
  
  <p>However I'm not getting the expected result:</p>
  
  <pre><code>In [21]: json_string = str({"id":"0","last_modified":"undefined"})
  In [22]: OrderedDict(eval(json_string))
  Out[23]: OrderedDict([('last_modified', 'undefined'), ('id', '0')])
  </code></pre>
  
  <p>I also haven't quite figured out yet how I'm going to write the output to excel in pretty print format, but I'd hope that'd be the comparatively easy part!</p>