xmltodict
Makes working with XML feel like you are working with JSON
Install
xmltodict on PyPI
pip
pip install xmltodictuv
uv add xmltodictpoetry
poetry add xmltodictPackage facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 172 days since the last release |
| Last repo commit | |
| First released | |
| Popularity | one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-13) |
Evidence: xmltodict-1.0.4-py3-none-any.whl
About xmltodict
from the package's own PyPI description — quoted content, verbatim
xmltodict
xmltodict is a Python module that makes working with XML feel like you are working with JSON, as in this "spec":
>>> print(json.dumps(xmltodict.parse("""
... <mydocument has="an attribute">
... <and>
... <many>elements</many>
... <many>more elements</many>
... </and>
... <plus a="complex">
... element as well
... </plus>
... </mydocument>
... """), indent=4))
{
"mydocument": {
"@has": "an attribute",
"and": {
"many": [
"elements",
"more elements"
]
},
"plus": {
"@a": "complex",
"#text": "element as well"
}
}
}
Namespace support
By default, xmltodict does no XML namespace processing (it just treats namespace declarations as regular node attributes), but passing process_namespaces=True will make it expand...
Read as markdown · JSON record · Source repository · Homepage
AI interpretation — verify before relying
AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page
xmltodict parses XML documents into Python dictionaries and converts them back to XML, treating XML structure like JSON for intuitive programmatic access.
Installs with zero runtime dependencies and low friction. Actively maintained with recent commits and 5751 GitHub stars; supports Python 3.9 through 3.14 and PyPy.
MIT license permits commercial and private use with minimal restrictions; you must include the license notice in distributions.
Usage
pip install xmltodict==1.0.4
import xmltodict
result = xmltodict.parse('<root><item>value</item></root>')
print(result) # {'root': {'item': 'value'}}
xml_out = xmltodict.unparse({'root': {'item': 'value'}})
print(xml_out) # <?xml version="1.0" encoding="utf-8"?><root><item>value</item></root>
Verdict: A lightweight, well-maintained XML-to-dict bridge with no dependencies, strong community adoption, and zero known vulnerabilities. Suitable for any Python 3.9+ project needing intuitive XML handling. MIT licensing poses no compliance burden.
Needs verification
- Whether streaming mode with item_callback is suitable for your specific XML file sizes and throughput requirements
- Performance characteristics compared to alternatives for your particular XML schema complexity
Similar packages
permissive · top 1,000 on PyPI
glompermissive · top 1,000 on PyPI
et-xmlfilepermissive · top 1,000 on PyPI
markdownifypermissive · top 1,000 on PyPI
cssselectpermissive · top 1,000 on PyPI
defusedxmlpermissive · top 1,000 on PyPI
cssselect2permissive · top 1,000 on PyPI
yamllintcopyleft · top 1,000 on PyPI
iniconfigpermissive · top 100 on PyPI
msrestpermissive · top 1,000 on PyPI