wiki:DataFormats

Flat files

Pickle

Currently we use the Python pickle library which is very simple (one line of code to save everything), but very brittle (any change to the object model breaks backwards compatibility).

Better Pickle: http://www-106.ibm.com/developerworks/linux/library/l-pypers.html Could use _getstate_() and _setstate_() to handle changes in the object model.

Twisted Versioned

Isn't actually a format, but a useful module for handling version upgrades http://twistedmatrix.com/documents/current/howto/upgrading.html http://twistedmatrix.com/documents/current/api/twisted.persisted.styles.Versioned.html

Twisted Jelly

S-expression-based persistence of python objects. jelly's main goals are security, human readability, and portability to other environments. http://twistedmatrix.com/documents/current/api/twisted.spread.jelly.html

Twisted Jelly renders to a list, so how to save to a disk? A: need banana.http://twistedmatrix.com/documents/current/api/twisted.spread.banana.Pynana.html

XML formats

Gnosis XML-Pickle

http://www.onlamp.com/pub/a/python/2003/04/17/metaclasses.html?page=2

Twisted Marmalade

I can serialize a Python object to an XML DOM tree (twisted.web.microdom), and therefore to XML data, similarly to twisted.spread.jelly. Because both Python lists and DOM trees are tree data-structures, many of the idioms used here are identical. http://twistedmatrix.com/documents/current/api/twisted.persisted.marmalade.html

Can't cope with booleans. Fixed in Twisted 2.0 version of Twisted, but Marmalade is marked as depreciated there :( ... can't win!

XIST

XIST is a "Python version of XSLT" http://www.livinglogic.de/Python/xist/ http://www.xml.com/pub/a/2005/03/16/py-xml.html

XMLObject/EaseXML

http://xmlobject.base-art.net/

YAML

Apparantly cool, but not well supported by Python? http://yaml.org/

Lightweight databases

Metakit

http://www.equi4.com/metakit/python.html

SQLite

http://www.sqlite.org/

Berkeley DB

http://www.sleepycat.com/

More links