xml to dictionary tool for python
Project description
xmlpydict 📑
Requirements
python 3.7+
Installation
To install xmlpydict, using pip:
pip install xmlpydict
Quickstart
>>> from xmlpydict import parse
>>> parse("<package><xmlpydict language='python'/></package>")
{'package': {'xmlpydict': {'@language': 'python'}}}
>>> parse("<person name='Matthew'>Hello!</person>")
{'person': {'@name': 'Matthew', '#text': 'Hello!'}}
Tags
dict.get(key[, default]) will not cause exceptions
# Empty tags are containers
>>> from xmlpydict import parse
>>> parse("<a></a>")
{'a': {}}
>>> parse("<a/>")
{'a': {}}
>>> parse("<a/>").get('href')
None
>>> parse("")
{}
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
xmlpydict-0.0.7.tar.gz
(7.8 kB
view hashes)
Built Distribution
Close
Hashes for xmlpydict-0.0.7-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0018633dae3469b6e1d24b4db4b96e4d75166fd2b2b6f21455cc9b9fdc5f903e |
|
MD5 | 297f1484a3a4d380c0e6e59f48e5677e |
|
BLAKE2b-256 | 78096a90b8e92a9cd7d21bd39bcebe390bf770a8ec438199b9bc15e6b5685e2d |