Convert python dictionary into a xml equivalent format
Project description
Convert python dictionary into a xml equivalent output
Usage of Pydicttoxml
d = {
'student': {
'name': 'Shera',
'age': 25,
'address': {
'pin': 500082,
'city': 'Hyderabad',
'state': 'telangana',
'country': 'India'
}
}
}
from pydicttoxml import dict2xml
xml = dict2xml(d, root_tag_name="data")
Output
<?xml version="1.0" encoding="UTF-8"?>
<data>
<student>
<name>Shera</name>
<age>25</age>
<address>
<pin>500082</pin>
<city>Hyderabad</city>
<state>telangana</state>
<country>India</country>
</address>
</student>
</data>
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pydicttoxml-1.0.1.tar.gz
(2.6 kB
view hashes)