# xmltodict

> Work with XML in Python as if it were JSON: parse it into dicts and back

Source: https://talira.ai/catalog/xmltodict-573f02aj
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / xml](https://talira.ai/categories/libraries/xml), [languages / python](https://talira.ai/categories/languages/python)
- Licence: MIT[^1]
- Pricing: Free and open source[^1]
- Pricing notes: Free and open source (MIT).
- Free tier: yes[^1]
- Backed by: [Martin Blech](https://talira.ai/orgs/martin-blech.md)

xmltodict is a Python module by Martin Blech that turns XML into nested dictionaries, so working with it feels like working with JSON: attributes become @-prefixed keys, text becomes #text, and repeated elements become lists. unparse() turns a dictionary back into XML. It's built on the Expat parser, has a streaming mode with a small memory footprint for large documents, handles namespaces, and can force chosen elements to lists or CDATA. Entity parsing is off by default.

## Links

- GitHub: https://github.com/martinblech/xmltodict

## Problems it solves

- read an XML API response in Python as a dict instead of walking a DOM
- convert XML to JSON in a Python script
- process a large XML file in Python without loading it all into memory

## Features

- XML to nested dicts and back (parse and unparse)
- streaming mode for large documents
- namespace support
- force_list and force_cdata for chosen elements
- entity parsing off by default

## Trust

Overall: 0.47 out of 1.
Signals: maintenance 0.45, adoption 0.75, momentum 0.46, community 0.71, backing 0.30, extensibility 0.00.

- last commit 3 months ago
- latest release v1.0.4 9 months ago
- 5.8k GitHub stars
- 60 contributors
- accepts sponsorship (Github)
- backed by Martin Blech

## Alternatives

- [lxml](https://talira.ai/catalog/lxml-7n17zqad.md): XML and HTML processing for Python

## Sources

[^1]: https://github.com/martinblech/xmltodict/blob/master/LICENSE (checked 29 Nov 2026)
