Skip to content

Releases: vinitkumar/json2xml

Security patch release

19 Jan 18:34
d346999

Choose a tag to compare

What's Changed

Full Changelog: v6.0.1...v6.0.2

v6.0.1 - Easy Rust Installation & Updated Benchmarks

16 Jan 07:14
be3c7ef

Choose a tag to compare

json2xml v6.0.1

This release enables the [fast] optional dependency and includes comprehensive benchmark comparisons.

🚀 Easy Rust Acceleration

You can now install json2xml with Rust acceleration in a single command:

pip install json2xml[fast]

This automatically installs both json2xml and json2xml-rs.

📊 Comprehensive Benchmark Results

Tested on Apple Silicon, comparing all implementations:

Performance Summary

Test Case Python Rust Go Zig
Small (47B) 40.12µs 1.45µs 4.65ms 3.74ms
Medium (3.2KB) 2.14ms 71.28µs 4.07ms 3.28ms
Large (32KB) 21.08ms 739.89µs 4.05ms 6.11ms
Very Large (323KB) 212.61ms 7.55ms 4.38ms 33.24ms

Speedup vs Pure Python

Test Case Rust Go Zig
Small (47B) 27.6x 0.0x* 0.0x*
Medium (3.2KB) 30.0x 0.5x* 0.7x*
Large (32KB) 28.5x 5.2x 3.5x
Very Large (323KB) 28.2x 48.5x 6.4x

*CLI tools have ~3-4ms process spawn overhead

Key Findings

  1. Rust is best for Python users - ~28x faster with zero overhead
  2. Go excels for large CLI workloads - 48x faster for 300KB+ files
  3. CLI startup overhead matters - Go/Zig slower for small files due to process spawn

📦 Installation Options

# Pure Python (always works)
pip install json2xml

# With Rust acceleration (recommended)
pip install json2xml[fast]

🔗 Related Projects

What's Changed

  • Enable [fast] optional dependency for easy Rust installation
  • Add comprehensive benchmark_all.py script
  • Update BENCHMARKS.md with Python/Rust/Go/Zig comparison

Full Changelog: v6.0.0...v6.0.1

v6.0.0 - Native Rust Extension for 29x Faster Performance

16 Jan 06:56
4e35529

Choose a tag to compare

json2xml v6.0.0 🚀

Major Release: Native Rust Extension for 29x Faster Performance

This release introduces an optional native Rust extension built with PyO3 that provides approximately 29x faster JSON to XML conversion compared to pure Python.

✨ Highlights

  • Optional Rust acceleration - Install json2xml-rs for blazing fast performance
  • Zero breaking changes - Pure Python version works exactly as before
  • Automatic backend selection - Use dicttoxml_fast module for auto-detection
  • Cross-platform wheels - Pre-built for Linux, macOS (Intel + Apple Silicon), Windows

📊 Performance Benchmarks

JSON Size Pure Python With Rust Speedup
Small (47 bytes) 6.85 µs 0.21 µs 33x
Medium (3.2KB) 160 µs 5.6 µs 28x
Large (32KB) 1.59 ms 53 µs 30x
Very Large (323KB) 16.4 ms 569 µs 29x

📦 Installation

# Pure Python (always works)
pip install json2xml

# With Rust acceleration (optional, recommended)
pip install json2xml json2xml-rs

🔧 Usage

# Option 1: Auto-selecting wrapper (recommended)
from json2xml.dicttoxml_fast import dicttoxml
xml = dicttoxml({"name": "John", "age": 30})

# Option 2: Direct Rust import (fastest, requires json2xml-rs)
from json2xml_rs import dicttoxml
xml = dicttoxml({"name": "John", "age": 30})

# Option 3: Pure Python (always available)
from json2xml.dicttoxml import dicttoxml
xml = dicttoxml({"name": "John", "age": 30})

📁 New Files

  • rust/ - PyO3 Rust extension source code
  • json2xml/dicttoxml_fast.py - Auto-selecting wrapper module
  • tests/test_rust_dicttoxml.py - 84 comprehensive tests
  • benchmark_rust.py - Performance comparison script
  • .github/workflows/build-rust-wheels.yml - CI for building wheels
  • .github/workflows/rust-ci.yml - CI for Rust code quality

⚠️ Rust Extension Limitations

The Rust implementation does not yet support:

  • ids parameter
  • item_func parameter
  • xml_namespaces parameter
  • xpath_format parameter
  • @attrs, @val, @flat special dict keys

For these features, use the pure Python implementation or dicttoxml_fast (which auto-falls back).

🔗 Related Projects

📝 Full Changelog

See HISTORY.rst for complete changelog.


Thank you to all contributors! 🙏

v5.4.0

14 Jan 18:59
cd62a33

Choose a tag to compare

What's Changed

Full Changelog: v5.3.1...v5.4.0

Xpath Support and Python freethreaded in CI

08 Dec 16:51
c9105c9

Choose a tag to compare

What's Changed

Full Changelog: v5.2.1...v5.3.1

Release with security fixes

12 Aug 10:14
3bf8ce9

Choose a tag to compare

What's Changed

  • Fixes #245
  • Updates many deps in main dependencies and test dependencies

Full Changelog: v5.2.0...v5.2.1

Security release and other fixes

20 Jul 19:31
43c4e18

Choose a tag to compare

What's Changed

  • 🔒 Security: Fix Jinja2 and py library vulnerabilities by @vinitkumar in #243
  • chore(deps): bump urllib3 from 2.3.0 to 2.5.0 by @dependabot[bot] in #244

Full Changelog: v5.1.0...v5.2.0

v5.1.0

12 Jun 16:49
b448ccc

Choose a tag to compare

What's Changed

Full Changelog: v5.0.5...v5.1.0

v5.0.5

31 Aug 16:38

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v5.0.4...v5.0.5

Make new Json2xml Python3.10+ only

08 Aug 17:56
39a4f80

Choose a tag to compare

What's Changed

  • Fix/drop python 38 python39 from identifier by @vinitkumar in #211
    We ensure that it won't be able to installed on old Python < 3.10 (So Python3.8, Python3.9)

Full Changelog: v5.0.3...v5.0.4