tags:

views:

80

answers:

2

I need to serialize my python objects to XML. I tried to use Django one but it's only for QuerySet objects and not for any simple Python object.

Is there any package to do that?

+4  A: 

http://freshmeat.net/projects/gnosisxml/

darelf
Thanks you very much,By noticed it serialize Python based objects (list , int ...)When I give it my custom objects it doesn't serialize it.Any helpThanks...
Wasim
Hi ,Thanks , it now works perfectly.But , I see that the dumps output many attributes I don't really want or don't want to return them to the client to save traffic , like id , module, familly and type.Do you know a way to drop them.Thanks...
Wasim
+2  A: 

You could also have a look at the objectify module from lxml.

jkp
I haven't actual used the lxml.objectify, but I do prefer lxml for straight xml processing. Very good library.
darelf
@darelf: aye, it's a great library indeed - king of the python XML libraries imho.
jkp