Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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.