title: Best way to save complex Python data structures across program sessions (pickle, json, xml, database, other)
body: <p>Looking for advice on the best technique for saving complex Python data structures across program sessions.</p>
  
  <p>Here's a list of techniques I've come up with so far:</p>
  
  <ul>
  <li>pickle/cpickle</li>
  <li>json</li>
  <li>jsonpickle</li>
  <li>xml</li>
  <li>database (like SQLite)</li>
  </ul>
  
  <p>Pickle is the easiest and fastest technique, but my understanding is that there is no guarantee that pickle output will work across various versions of Python 2.x/3.x or across 32 and 64 bit implementations of Python.</p>
  
  <p>Json only works for simple data structures. Jsonpickle seems to correct this AND seems to be written to work across different versions of Python.</p>
  
  <p>Serializing to XML or to a database is possible, but represents extra effort since we would have to do the serialization ourselves manually.</p>
  
  <p>Thank you,
  Malcolm</p>