Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python xml marshalling

I'm learning Python, my background is Java EE. I have used JAXB before, where I can basically define a regular class, throw some annotations in there and then use JAXB to marshall objects to xml. This means I am not concerned with creating root elements, nodes, etc. but merely writing the Java class and anotating it here and there. Is there anything like this for Python?

like image 468
arg20 Avatar asked Oct 03 '12 10:10

arg20


2 Answers

Here are a few:

  • lxml.objectify

  • gnosis.xml.objecity

  • pyxser seems pretty cool

  • Pickle to XML - uses Python's pickle and xml.dom.minidom

  • pyxml -from xml import marshal (might be buggy)

  • Amara might be worth looking into.

like image 170
Anuj Gupta Avatar answered Oct 12 '22 21:10

Anuj Gupta


PyXB seems to be the closest thing to JAXB although I haven't used it yet. I use lxml at the moment and find it works well. Amara was promising but seemed to stagnate.

like image 38
Alastair McCormack Avatar answered Oct 12 '22 20:10

Alastair McCormack