dicttoxml2
Converts a Python dictionary or other native data type into a valid XML string.
What it is and what it does
dicttoxml2 is a lightweight library that serializes Python dictionaries and other native data types into XML strings. It is a maintained fork of the original dicttoxml, updated to support Python 3.7 and forward while dropping support for end-of-life Python versions. The package has no external runtime dependencies, making installation straightforward.
The library is intended as a drop-in replacement for the original dicttoxml. It supports Python 3.7, 3.8, 3.9, 3.10, and 3.11 according to its classifiers and is marked as production-stable. However, the package has been abandoned since 2022-08-13 with no commits or releases since that date, meaning it will not receive updates for new Python versions or bug fixes.
Use it for:
- Serialize application configuration stored in Python dicts to XML format for interoperability with XML-based systems
- Convert REST API response data (typically dict-like) to XML for clients that require XML output
- Generate XML documents programmatically from nested Python data structures without writing XML by hand
- Export structured data from Python applications to XML files for archival or data interchange
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Converts Python dictionaries and native data types into valid XML strings with no external runtime dependencies.
Yes, if you need simple dict-to-XML conversion and are running Python 3.7–3.11 without plans to upgrade soon. The low install friction and lack of dependencies make it lightweight. However, the GPL-2.0 copyleft license restricts use in proprietary projects, and the package's abandonment since 2022-08-13 means no future maintenance or Python version support—consider this a stable but frozen tool suitable only for stable, unchanging environments.
Install
dicttoxml2 on PyPI
pip
pip install dicttoxml2uv
uv add dicttoxml2poetry
poetry add dicttoxml2Installing dicttoxml2
Before you install
Low install friction with no runtime dependencies. Package is abandoned as of 2022-08-13 with no commits since; relies on stable Python 3.7+ support.
License in practice
Released under GPL-2.0 (copyleft). Any derivative work or distribution must also be licensed under GPL-2.0 and include source code; this may restrict use in proprietary projects.
Quickstart
pip install dicttoxml2
import dicttoxml2
xml = dicttoxml2.dicttoxml({'key': 'value'})
Verify before relying
- Whether the package handles edge cases in dict-to-XML conversion (nested structures, special characters, type coercion) as expected
- Whether abandonment since 2022-08-13 means compatibility issues have emerged with Python 3.10+ in real-world use
Package facts
| License | GPL-2.0 (copyleft) |
| Python support | supports the current Python release (>=3.7, <4) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 1,462 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 119,152/month — #12,085 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: dicttoxml2-2.1.0-py3-none-any.whl
Tags
More Markup packages
PyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
markdown-it-pyA Python markdown parser that converts markdown…
permissive · top 100 on PyPI
beautifulsoup4Beautiful Soup parses HTML and XML documents…
permissive · top 100 on PyPI
et-xmlfileet_xmlfile writes large XML files with minimal…
permissive · top 1,000 on PyPI
tomlkitParses and edits TOML files while preserving…
permissive · top 1,000 on PyPI
docstring-parserParses Python docstrings in ReST, Google,…
permissive · top 1,000 on PyPI
dicttoxmlConverts Python dictionaries and other native…
copyleft · top 5,000 on PyPI
xml-pythonConverts XML documents into Python objects,…
copyleft · top 5,000 on PyPI
dict2xmlConverts Python dictionaries into XML strings…
permissive · top 5,000 on PyPI
untangleConverts XML documents into Python objects with…
permissive · top 15,000 on PyPI
jxmleaseConverts XML to Python data structures (lists,…
permissive · top 15,000 on PyPI
jsonsConverts Python objects (dataclasses, attrs…
permissive · top 5,000 on PyPI
xmljsonConverts XML documents to Python dictionaries…
permissive · top 5,000 on PyPI
data-to-xmlConverts Python dictionaries and lists into XML…
unclear · top 15,000 on PyPI
xmltojsonConverts XML documents to JSON format via a…
permissive · top 15,000 on PyPI
soup2dictConverts BeautifulSoup4 parsed HTML or XML…
permissive · top 15,000 on PyPI