Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bahamas10/xmlserialize
XML Serializer for python. Convert a python dictionary into XML.
https://github.com/bahamas10/xmlserialize
Last synced: 18 days ago
JSON representation
XML Serializer for python. Convert a python dictionary into XML.
- Host: GitHub
- URL: https://github.com/bahamas10/xmlserialize
- Owner: bahamas10
- License: bsd-3-clause
- Created: 2012-05-15T20:00:21.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-06-06T05:42:26.000Z (over 12 years ago)
- Last Synced: 2024-11-14T05:44:17.190Z (2 months ago)
- Language: Python
- Size: 93.8 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
xmlserialize
============XML Serializer for python. Convert a python dictionary into XML.
Usage
=====#### Obect-Oriented Approach
``` python
>>> import XMLDict
>>> obj = { "people" : { "person" : [ "dave", "john", "steve", "mike", "jack" ] } }
>>> xml_dict = XMLDict.XMLDict(obj)
>>> print xml_dict.get_xml()
davejohnstevemikejack
>>> print xml_dict.get_pretty_xml()
dave
john
steve
mike
jack
>>>
```#### Convenience Methods
``` python
>>> import XMLDict
>>> obj = { "people" : { "person" : [ "dave", "john", "steve", "mike", "jack" ] } }
>>> print XMLDict.convert_dict_to_xml(obj)
davejohnstevemikejack
>>> print XMLDict.prettify(XMLDict.convert_dict_to_xml(obj))
dave
john
steve
mike
jack
>>>
```Command Line
============dave @ [ bahamas10 :: (SunOS) ] ~/dev/xmlserialize $ ./XMLDict.py
dave
john
steve
mike
jack
Copying
=======Released under the BSD 3-clause license, see LICENSE for details.