Makes working with XML feel like you are working with JSON

Edit Package python-xmltodict
https://github.com/martinblech/xmltodict

xmltodict is a Python module that makes working with XML feel like you are
working with JSON. It's very fast (Expat-based) and has a streaming mode
with a small memory footprint, suitable for big XML dumps like Discogs or
Wikipedia.

>>> doc = xmltodict.parse("""
...
...
... elements
... more elements
...
...
... element as well
...
...
... """)
>>>
>>> doc['mydocument']['@has']
u'an attribute'
>>> doc['mydocument']['and']['many']
[u'elements', u'more elements']
>>> doc['mydocument']['plus']['@a']
u'complex'
>>> doc['mydocument']['plus']['#text']
u'element as well'

Refresh
Refresh
Source Files
Filename Size Changed
python-xmltodict.spec 0000004950 4.83 KB
xmltodict-0.9.0.tar.gz 0000037078 36.2 KB
Latest Revision
Mark Stopka's avatar Mark Stopka (m4r3k) committed (revision 1)
Comments 0
openSUSE Build Service is sponsored by