Templating utilities
Project description
Neodict2XML
Neomyte's dict to XML converter
Example:
>>> from neodict2xml import dict2xml
>>> test_dict = {\
'test': {\
'plop': ({'attr': 'brrr'}, 'lol'),\
'lol': [\
'hello',\
'world'\
],\
'deep': {\
'deeper': 1\
},\
'test2': [\
{ 'foo': 'bar' },\
( { 'id': 2 }, { 'foo': 'rab' } )\
],\
'test3': ( { 'class': 'foo.Bar' }, )\
}\
}
>>> xml = dict2xml.from_dict(test_dict)
>>> print(dict2xml.prettify(xml))
<?xml version="1.0" ?>
<test>
<plop attr="brrr">lol</plop>
<lol>hello</lol>
<lol>world</lol>
<deep>
<deeper>1</deeper>
</deep>
<test2>
<foo>bar</foo>
</test2>
<test2 id="2">
<foo>rab</foo>
</test2>
<test3 class="foo.Bar"/>
</test>
Contributors
- Emmanuel Pluot (aka. Neomyte)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Neodict2XML-0.0.2.tar.gz
(2.9 kB
view hashes)
Built Distribution
Close
Hashes for Neodict2XML-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd96776f213d301708dd6a5c63440ffb46c09241ba7e29d6401ce4de645a0e95 |
|
MD5 | b972b0b14cd4db05aeef989471f4100f |
|
BLAKE2b-256 | 0a3a3371f1e01f3d48ff55bc71caf9f9200141eceee33f2e8b08421a0722ff83 |