On May 23, 2013 3:42 AM, "Schneider" <j...@globe.de> wrote:
>
> Hi list,
>
> how can I serialize a python class to XML? Plus a way to get the class back from the XML?
There's pyxser: http://pythonhosted.org/pyxser/
> My aim is to store instances of this class in a database.
Honestly, I would avoid XML if you can. Consider using JSON (Python includes the `json` module in the std lib) or pickle instead. Compared to XML: The former is more standardized (in the context of serializing objects) and less verbose; the latter is more efficient (if you don't care about cross-language accessibility); both have more convenient APIs.
Cheers,
Chris