xmljson
Converts XML into JSON/Python dicts/arrays and vice-versa.
What it is and what it does
xmljson is a bidirectional XML-to-JSON converter that transforms XML documents into Python dictionaries and vice versa. It implements six standardized conventions (Abdera, BadgerFish, Cobra, GData, Parker, and Yahoo) for how XML attributes, text content, and nested elements map to JSON-like dictionary structures. The library is pure Python with no external runtime dependencies, making it lightweight to install.
The package is no longer actively maintained—the last release was in April 2020 and the repository is now archived. The author explicitly recommends alternatives like xmltodict and untangle for new projects. Use xmljson only if you need to parse XML using one of its specific conventions, or if you are maintaining legacy code that already depends on it.
Use it for:
- Convert XML API responses to Python dicts for processing when a specific JSON convention is required by your data pipeline
- Transform structured XML documents to JSON format for storage or transmission using standardized conventions
- Parse XML with attribute preservation using BadgerFish convention (prefixing attributes with @)
- Generate XML from Python dictionaries following a chosen convention, then serialize with ElementTree
- CLI tool to batch-convert XML files to JSON using one of the supported conventions
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Converts XML documents to Python dictionaries (and back) using one of six standardized XML-to-JSON conventions, with support for custom attribute and text-content handling.
No, unless you are maintaining existing code that depends on it. The package is abandoned (last release April 2020, repository archived), receives no security updates, and the author recommends xmltodict or untangle for new projects. Install friction is low and there are no known vulnerabilities, but the lack of maintenance and explicit guidance toward alternatives makes it unsuitable for new development.
Install
xmljson on PyPI
pip
pip install xmljsonuv
uv add xmljsonpoetry
poetry add xmljsonInstalling xmljson
Before you install
Installation is frictionless (pure Python, no runtime dependencies), but the package is abandoned—last release was 2020-04-25 and the repository is archived. No active maintenance or security updates should be expected.
License in practice
MIT license is permissive; you may use, modify, and distribute this package freely with minimal restrictions, though you should include the license notice.
Quickstart
pip install xmljson
from xmljson import badgerfish as bf
from xml.etree.ElementTree import fromstring
xml_string = '<p id="main">Hello</p>'
data = bf.data(fromstring(xml_string))
print(data)
Verify before relying
- Whether the package works reliably with modern Python versions beyond 3.7 (classifiers list only up to 3.7)
- Performance characteristics with large XML documents
- Compatibility with lxml or other ElementTree implementations beyond the standard library
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 2,302 days since the last release |
| Last repo commit | (repository archived) |
| First released | |
| Downloads | 1,049,180/month — #4,445 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: xmljson-0.2.1-py2.py3-none-any.whl
Keywords: xmljson
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
dict2xmlConverts Python dictionaries into XML strings…
permissive · top 5,000 on PyPI
xmltodictConverts XML to Python dictionaries and back,…
permissive · top 1,000 on PyPI
untangleConverts XML documents into Python objects with…
permissive · top 15,000 on PyPI
dicttoxmlConverts Python dictionaries and other native…
copyleft · top 5,000 on PyPI
xmltojsonConverts XML documents to JSON format via a…
permissive · top 15,000 on PyPI
jxmleaseConverts XML to Python data structures (lists,…
permissive · top 15,000 on PyPI
json-tricksExtends Python's JSON serialization to handle…
permissive · top 15,000 on PyPI
xml-pythonConverts XML documents into Python objects,…
copyleft · top 5,000 on PyPI
types-xmltodictProvides type annotations for the xmltodict…
permissive · top 5,000 on PyPI
xmlformatterFormats and compresses XML documents by…
permissive · top 15,000 on PyPI