--- id: xmltodict version: "1.0.4" license: MIT license_treatment: permissive maintenance: active --- # xmltodict — Makes working with XML feel like you are working with JSON License: permissive · Maintenance: active · Popularity: top 1,000 on PyPI ## Install pip install xmltodict uv add xmltodict poetry add xmltodict ## Description # xmltodict `xmltodict` is a Python module that makes working with XML feel like you are working with [JSON](http://docs.python.org/library/json.html), as in this ["spec"](http://www.xml.com/pub/a/2006/05/31/converting-between-xml-and-json.html): [![Tests](https://github.com/martinblech/xmltodict/actions/workflows/test.yml/badge.svg)](https://github.com/martinblech/xmltodict/actions/workflows/test.yml) ```python >>> print(json.dumps(xmltodict.parse(""" ... ... ... elements ... more elements ... ... ... element as well ... ... ... """), 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... ## AI interpretation — verify before relying xmltodict parses XML documents into Python dictionaries and converts them back to XML, treating XML structure like JSON for intuitive programmatic access. 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. [View on SkillFed](https://skillfed.io/packages/xmltodict) · [View on PyPI](https://pypi.org/project/xmltodict/)