--- id: json2xml version: "6.5.1" license: Apache Software License 2.0 license_treatment: permissive maintenance: active --- # json2xml — Simple Python Library to convert JSON to XML License: permissive · Maintenance: active · Downloads: 328.9K/mo ## 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 above — verify before relying. Converts JSON data to XML format via Python library or CLI tool, with optional Rust acceleration for performance-critical workloads. 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 pip install json2xml uv add json2xml poetry add json2xml ## Installing json2xml 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. 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()) Requires Python 3.10 or later. 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_current - Install friction: low - Maintenance: active - Downloads: 328.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags json to xml conversion, json xml serialization, cli json xml tool, python json xml library, api response xml conversion, json file to xml, xpath 3.1 compatible xml, data-format-conversion, cli-tool, rust-accelerated [View on SkillFed](https://skillfed.io/packages/json2xml) · [View on PyPI](https://pypi.org/project/json2xml/)