skillfed

xmljson

Converts XML into JSON/Python dicts/arrays and vice-versa.

xmljson v0.2.1 1.0M downloads/30d#4,445 on PyPI125
Permissive license MIT Abandoned released

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 xmljson

uv

uv add xmljson

poetry

poetry add xmljson

Installing 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

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Topic :: Software DevelopmentTopic :: Software Development :: Libraries :: Python Modules

Tags

xml to json conversionxml to python dictxml parsing conventionsbadgerfish xml conversionxml json bidirectionalstructured xml parsingxml data transformation
xml-parsingabandoned

More Software Development packages