json2xml
Simple Python Library to convert JSON to XML
Decision gist · record as of 2026-08-14
Yes. The package is actively maintained, has no known vulnerabilities, installs with low friction, and solves a focused problem well. The permissive Apache 2.0 license imposes no restrictions. The optional Rust acceleration is a genuine performance option for throughput-critical work, but the pure Python fallback ensures broad compatibility. Suitable for both library integration and CLI scripting.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Low friction installation with a pure Python fallback path.
- Actively maintained with a release 10 days old; supports modern Python versions (3.10–3.14) and PyPy.
License · maintenance · safety
Apache Software License 2.0 (permissive) — Licensed under Apache Software License 2.0 (permissive), allowing commercial and private use with minimal restrictions.
last release 2026-08-04 (10 days) · last repo commit 2026-08-13 · 109 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 328,914 downloads/mo, #7,550 on PyPI
Alternatives
Verify before relying
pip install json2xml
from json2xml import json2xml
from json2xml.utils import readfromstring
data = readfromstring('{"name": "Ada", "language": "Python"}')
print(json2xml.Json2xml(data).to_xml())- Whether the Rust extension (json2xml[fast]) is available for all target platforms or only specific architectures.
- Actual performance gains on typical workloads in production environments versus the benchmark figures cited.
What it is and what it does
json2xml is a Python library and command-line tool for converting JSON data into XML. It handles JSON strings, files, and API responses, producing XPath 3.1 compatible output. The library was originally built on dict2xml but has since integrated that functionality directly, adding type hints, tests, and performance improvements.
The package offers both a pure Python implementation and an optional Rust extension for acceleration. The pure Python path runs on all supported platforms and versions; the Rust extension is automatically used when available and falls back to Python when a feature isn't natively supported. It depends on defusedxml for secure XML handling and urllib3 for URL fetching, with built-in protections against private network access and oversized responses.
Use it for
- Convert JSON API responses to XML when downstream systems or legacy services require XML input.
- Batch-convert JSON files to XML from the command line using the json2xml-py CLI tool.
- Process JSON data from URLs in Python with automatic security controls (no redirects, private network rejection by default).
- Generate XPath 3.1 compliant XML output for standards-based XML processing pipelines.
- Accelerate high-volume JSON-to-XML conversion with the optional Rust extension for latency-sensitive applications.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is actively maintained, has no known vulnerabilities, installs with low friction, and solves a focused problem well. The permissive Apache 2.0 license imposes no restrictions. The optional Rust acceleration is a genuine performance option for throughput-critical work, but the pure Python fallback ensures broad compatibility. Suitable for both library integration and CLI scripting.
Install
json2xml on PyPI
Before you install
Low friction installation with a pure Python fallback path. Actively maintained with a release 10 days old; supports modern Python versions (3.10–3.14) and PyPy. Optional Rust extension available for performance-sensitive use.
Requires Python 3.10 or later.
License in practice
Licensed under Apache Software License 2.0 (permissive), allowing commercial and private use with minimal restrictions.
Quickstart
pip install json2xml
from json2xml import json2xml
from json2xml.utils import readfromstring
data = readfromstring('{"name": "Ada", "language": "Python"}')
print(json2xml.Json2xml(data).to_xml())
Verify before relying
- Whether the Rust extension (json2xml[fast]) is available for all target platforms or only specific architectures.
- Actual performance gains on typical workloads in production environments versus the benchmark figures cited.
Package facts
| License | Apache Software License 2.0 permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagesdefusedxmlurllib3 |
| Maintenance | Actively maintained 10 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 328,914 / month, #7,550 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 6 - MatureIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseNatural Language :: EnglishProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Libraries :: Python Modules |
Evidence: json2xml-6.5.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “json to xml conversion”
- json2xmlConverts JSON data to XML format via Python library or CLI tool, with…
- xmltojsonConverts XML documents to JSON format via a Python library or…
- xmljsonConverts XML documents to Python dictionaries (and back) using one of…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also dicttoxml · lxml · parsel · xmltojson · xmlunittest · jinja2-cli · elementpath · dict2xml · jxmlease · cloudmersive-convert-api-client