Makes working with XML feel like you are working with JSON
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'
- Download package
-
Checkout Package
osc -A https://api.opensuse.org checkout isv:perlur:epel/python-xmltodict && cd $_
- Create Badge
Refresh
Refresh
Source Files
Filename | Size | Changed |
---|---|---|
python-xmltodict.spec | 0000004950 4.83 KB | |
xmltodict-0.9.0.tar.gz | 0000037078 36.2 KB |
Comments 0