json2xml 6.0.0__tar.gz → 6.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {json2xml-6.0.0 → json2xml-6.0.2}/HISTORY.rst +19 -0
- {json2xml-6.0.0 → json2xml-6.0.2}/PKG-INFO +58 -41
- {json2xml-6.0.0 → json2xml-6.0.2}/README.rst +55 -40
- {json2xml-6.0.0 → json2xml-6.0.2}/json2xml/__init__.py +1 -1
- {json2xml-6.0.0 → json2xml-6.0.2}/json2xml.egg-info/PKG-INFO +58 -41
- {json2xml-6.0.0 → json2xml-6.0.2}/json2xml.egg-info/requires.txt +3 -0
- {json2xml-6.0.0 → json2xml-6.0.2}/pyproject.toml +2 -6
- {json2xml-6.0.0 → json2xml-6.0.2}/requirements.in +1 -1
- {json2xml-6.0.0 → json2xml-6.0.2}/AUTHORS.rst +0 -0
- {json2xml-6.0.0 → json2xml-6.0.2}/CONTRIBUTING.rst +0 -0
- {json2xml-6.0.0 → json2xml-6.0.2}/LICENSE +0 -0
- {json2xml-6.0.0 → json2xml-6.0.2}/MANIFEST.in +0 -0
- {json2xml-6.0.0 → json2xml-6.0.2}/docs/Makefile +0 -0
- {json2xml-6.0.0 → json2xml-6.0.2}/docs/authors.rst +0 -0
- {json2xml-6.0.0 → json2xml-6.0.2}/docs/benchmarks.rst +0 -0
- {json2xml-6.0.0 → json2xml-6.0.2}/docs/conf.py +0 -0
- {json2xml-6.0.0 → json2xml-6.0.2}/docs/contributing.rst +0 -0
- {json2xml-6.0.0 → json2xml-6.0.2}/docs/history.rst +0 -0
- {json2xml-6.0.0 → json2xml-6.0.2}/docs/index.rst +0 -0
- {json2xml-6.0.0 → json2xml-6.0.2}/docs/installation.rst +0 -0
- {json2xml-6.0.0 → json2xml-6.0.2}/docs/json2xml.rst +0 -0
- {json2xml-6.0.0 → json2xml-6.0.2}/docs/make.bat +0 -0
- {json2xml-6.0.0 → json2xml-6.0.2}/docs/modules.rst +0 -0
- {json2xml-6.0.0 → json2xml-6.0.2}/docs/readme.rst +0 -0
- {json2xml-6.0.0 → json2xml-6.0.2}/docs/usage.rst +0 -0
- {json2xml-6.0.0 → json2xml-6.0.2}/json2xml/cli.py +0 -0
- {json2xml-6.0.0 → json2xml-6.0.2}/json2xml/dicttoxml.py +0 -0
- {json2xml-6.0.0 → json2xml-6.0.2}/json2xml/dicttoxml_fast.py +0 -0
- {json2xml-6.0.0 → json2xml-6.0.2}/json2xml/json2xml.py +0 -0
- {json2xml-6.0.0 → json2xml-6.0.2}/json2xml/utils.py +0 -0
- {json2xml-6.0.0 → json2xml-6.0.2}/json2xml.egg-info/SOURCES.txt +0 -0
- {json2xml-6.0.0 → json2xml-6.0.2}/json2xml.egg-info/dependency_links.txt +0 -0
- {json2xml-6.0.0 → json2xml-6.0.2}/json2xml.egg-info/entry_points.txt +0 -0
- {json2xml-6.0.0 → json2xml-6.0.2}/json2xml.egg-info/top_level.txt +0 -0
- {json2xml-6.0.0 → json2xml-6.0.2}/setup.cfg +0 -0
- {json2xml-6.0.0 → json2xml-6.0.2}/setup.py +0 -0
- {json2xml-6.0.0 → json2xml-6.0.2}/tests/__init__.py +0 -0
- {json2xml-6.0.0 → json2xml-6.0.2}/tests/conftest.py +0 -0
- {json2xml-6.0.0 → json2xml-6.0.2}/tests/test_cli.py +0 -0
- {json2xml-6.0.0 → json2xml-6.0.2}/tests/test_dict2xml.py +0 -0
- {json2xml-6.0.0 → json2xml-6.0.2}/tests/test_json2xml.py +0 -0
- {json2xml-6.0.0 → json2xml-6.0.2}/tests/test_missing_coverage.py +0 -0
- {json2xml-6.0.0 → json2xml-6.0.2}/tests/test_rust_dicttoxml.py +0 -0
- {json2xml-6.0.0 → json2xml-6.0.2}/tests/test_utils.py +0 -0
|
@@ -1,6 +1,25 @@
|
|
|
1
1
|
History
|
|
2
2
|
=======
|
|
3
3
|
|
|
4
|
+
6.0.2 / 2026-01-20
|
|
5
|
+
==================
|
|
6
|
+
|
|
7
|
+
* fix: upgrade urllib3 to patched version (#269)
|
|
8
|
+
* Update README.rst (#268)
|
|
9
|
+
* docs: update README with comprehensive benchmark results
|
|
10
|
+
|
|
11
|
+
6.0.1 / 2026-01-16
|
|
12
|
+
==================
|
|
13
|
+
|
|
14
|
+
* feat: enable 'fast' optional dependency for easy Rust installation
|
|
15
|
+
* docs: update benchmarks with comprehensive Python/Rust/Go/Zig comparison
|
|
16
|
+
* feat: add benchmark_all.py for multi-implementation benchmarking
|
|
17
|
+
|
|
18
|
+
Installation with Rust acceleration:
|
|
19
|
+
|
|
20
|
+
* pip install json2xml[fast]
|
|
21
|
+
|
|
22
|
+
|
|
4
23
|
6.0.0 / 2026-01-16
|
|
5
24
|
==================
|
|
6
25
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: json2xml
|
|
3
|
-
Version: 6.0.
|
|
3
|
+
Version: 6.0.2
|
|
4
4
|
Summary: Simple Python Library to convert JSON to XML
|
|
5
5
|
Author-email: Vinit Kumar <mail@vinitkumar.me>
|
|
6
6
|
License: Apache Software License 2.0
|
|
@@ -31,6 +31,8 @@ Requires-Dist: coverage
|
|
|
31
31
|
Requires-Dist: setuptools
|
|
32
32
|
Provides-Extra: test
|
|
33
33
|
Requires-Dist: pytest>=8.4.1; extra == "test"
|
|
34
|
+
Provides-Extra: fast
|
|
35
|
+
Requires-Dist: json2xml-rs>=0.1.0; extra == "fast"
|
|
34
36
|
Dynamic: license-file
|
|
35
37
|
|
|
36
38
|
.. image:: ./json2xml-hero.png
|
|
@@ -78,21 +80,19 @@ Installation
|
|
|
78
80
|
|
|
79
81
|
pip install json2xml
|
|
80
82
|
|
|
81
|
-
**With Native Rust Acceleration (
|
|
83
|
+
**With Native Rust Acceleration (28x faster)**
|
|
82
84
|
|
|
83
85
|
For maximum performance, install the optional Rust extension:
|
|
84
86
|
|
|
85
87
|
.. code-block:: console
|
|
86
88
|
|
|
87
|
-
# Install json2xml with Rust acceleration
|
|
89
|
+
# Install json2xml with Rust acceleration
|
|
88
90
|
pip install json2xml[fast]
|
|
89
91
|
|
|
90
92
|
# Or install the Rust extension separately
|
|
91
93
|
pip install json2xml-rs
|
|
92
94
|
|
|
93
|
-
The Rust extension provides **
|
|
94
|
-
|
|
95
|
-
*Note: The ``json2xml-rs`` package will be available on PyPI after the first Rust release.*
|
|
95
|
+
The Rust extension provides **28x faster** conversion compared to pure Python. It's automatically used when available, with seamless fallback to pure Python.
|
|
96
96
|
|
|
97
97
|
**As a CLI Tool**
|
|
98
98
|
|
|
@@ -465,21 +465,21 @@ For users who need maximum performance within Python, json2xml includes an optio
|
|
|
465
465
|
- Rust Extension
|
|
466
466
|
- Speedup
|
|
467
467
|
* - **Small JSON** (47 bytes)
|
|
468
|
-
-
|
|
469
|
-
- 1.
|
|
470
|
-
- **
|
|
468
|
+
- 40µs
|
|
469
|
+
- 1.5µs
|
|
470
|
+
- **27x**
|
|
471
471
|
* - **Medium JSON** (3.2 KB)
|
|
472
472
|
- 2.1ms
|
|
473
|
-
-
|
|
474
|
-
- **28x**
|
|
475
|
-
* - **Large JSON** (32 KB)
|
|
476
|
-
- 21.5ms
|
|
477
|
-
- 727µs
|
|
473
|
+
- 71µs
|
|
478
474
|
- **30x**
|
|
475
|
+
* - **Large JSON** (32 KB)
|
|
476
|
+
- 21ms
|
|
477
|
+
- 740µs
|
|
478
|
+
- **28x**
|
|
479
479
|
* - **Very Large JSON** (323 KB)
|
|
480
|
-
-
|
|
481
|
-
- 7.
|
|
482
|
-
- **
|
|
480
|
+
- 213ms
|
|
481
|
+
- 7.5ms
|
|
482
|
+
- **28x**
|
|
483
483
|
|
|
484
484
|
**Usage with Rust Extension:**
|
|
485
485
|
|
|
@@ -509,38 +509,54 @@ For other platforms, the pure Python version is used automatically.
|
|
|
509
509
|
Performance Benchmarks
|
|
510
510
|
^^^^^^^^^^^^^^^^^^^^^^
|
|
511
511
|
|
|
512
|
-
Comprehensive benchmarks comparing
|
|
512
|
+
Comprehensive benchmarks comparing all implementations (Apple Silicon, January 2026):
|
|
513
513
|
|
|
514
514
|
.. list-table::
|
|
515
515
|
:header-rows: 1
|
|
516
|
-
:widths:
|
|
516
|
+
:widths: 22 18 15 15 15 15
|
|
517
517
|
|
|
518
518
|
* - Test Case
|
|
519
|
-
- Python
|
|
519
|
+
- Python
|
|
520
|
+
- Rust
|
|
520
521
|
- Go
|
|
521
522
|
- Zig
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
-
|
|
525
|
-
-
|
|
526
|
-
|
|
527
|
-
-
|
|
528
|
-
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
-
|
|
532
|
-
-
|
|
533
|
-
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
-
|
|
537
|
-
-
|
|
523
|
+
- Best
|
|
524
|
+
* - **Small** (47B)
|
|
525
|
+
- 40µs
|
|
526
|
+
- 1.5µs
|
|
527
|
+
- 4.6ms
|
|
528
|
+
- 3.7ms
|
|
529
|
+
- Rust (28x)
|
|
530
|
+
* - **Medium** (3.2KB)
|
|
531
|
+
- 2.1ms
|
|
532
|
+
- 71µs
|
|
533
|
+
- 4.1ms
|
|
534
|
+
- 3.3ms
|
|
535
|
+
- Rust (30x)
|
|
536
|
+
* - **Large** (32KB)
|
|
537
|
+
- 21ms
|
|
538
|
+
- 740µs
|
|
539
|
+
- 4ms
|
|
540
|
+
- 6.1ms
|
|
541
|
+
- Rust (28x)
|
|
542
|
+
* - **Very Large** (323KB)
|
|
543
|
+
- 213ms
|
|
544
|
+
- 7.5ms
|
|
545
|
+
- 4.4ms
|
|
546
|
+
- 33ms
|
|
547
|
+
- Go (48x)
|
|
548
|
+
|
|
549
|
+
**Key Findings:**
|
|
550
|
+
|
|
551
|
+
- **Rust extension**: ~28x faster than Python, zero overhead (best for Python users)
|
|
552
|
+
- **Go CLI**: 48x faster for large files (300KB+), but has ~4ms startup overhead
|
|
553
|
+
- **Zig CLI**: 3-6x faster for medium-large files
|
|
538
554
|
|
|
539
555
|
**Recommendation by Use Case:**
|
|
540
556
|
|
|
541
|
-
- **Python
|
|
542
|
-
- **
|
|
543
|
-
- **
|
|
557
|
+
- **Python library calls**: Use ``pip install json2xml[fast]`` (Rust, 28x faster)
|
|
558
|
+
- **Large file CLI processing**: Use `json2xml-go <https://github.com/vinitkumar/json2xml-go>`_ (Go, 48x for 300KB+)
|
|
559
|
+
- **Pure Python required**: Use ``pip install json2xml``
|
|
544
560
|
|
|
545
561
|
For detailed benchmarks, see `BENCHMARKS.md <https://github.com/vinitkumar/json2xml/blob/master/BENCHMARKS.md>`_.
|
|
546
562
|
|
|
@@ -550,8 +566,9 @@ Other Implementations
|
|
|
550
566
|
|
|
551
567
|
This library is also available in other languages:
|
|
552
568
|
|
|
553
|
-
- **
|
|
554
|
-
- **
|
|
569
|
+
- **Rust**: `json2xml-rs <https://pypi.org/project/json2xml-rs/>`_ - 28x faster, Python extension via PyO3
|
|
570
|
+
- **Go**: `json2xml-go <https://github.com/vinitkumar/json2xml-go>`_ - 48x faster for large files, native CLI
|
|
571
|
+
- **Zig**: `json2xml-zig <https://github.com/vinitkumar/json2xml-zig>`_ - 6x faster, native CLI
|
|
555
572
|
|
|
556
573
|
|
|
557
574
|
Help and Support to maintain this project
|
|
@@ -43,21 +43,19 @@ Installation
|
|
|
43
43
|
|
|
44
44
|
pip install json2xml
|
|
45
45
|
|
|
46
|
-
**With Native Rust Acceleration (
|
|
46
|
+
**With Native Rust Acceleration (28x faster)**
|
|
47
47
|
|
|
48
48
|
For maximum performance, install the optional Rust extension:
|
|
49
49
|
|
|
50
50
|
.. code-block:: console
|
|
51
51
|
|
|
52
|
-
# Install json2xml with Rust acceleration
|
|
52
|
+
# Install json2xml with Rust acceleration
|
|
53
53
|
pip install json2xml[fast]
|
|
54
54
|
|
|
55
55
|
# Or install the Rust extension separately
|
|
56
56
|
pip install json2xml-rs
|
|
57
57
|
|
|
58
|
-
The Rust extension provides **
|
|
59
|
-
|
|
60
|
-
*Note: The ``json2xml-rs`` package will be available on PyPI after the first Rust release.*
|
|
58
|
+
The Rust extension provides **28x faster** conversion compared to pure Python. It's automatically used when available, with seamless fallback to pure Python.
|
|
61
59
|
|
|
62
60
|
**As a CLI Tool**
|
|
63
61
|
|
|
@@ -430,21 +428,21 @@ For users who need maximum performance within Python, json2xml includes an optio
|
|
|
430
428
|
- Rust Extension
|
|
431
429
|
- Speedup
|
|
432
430
|
* - **Small JSON** (47 bytes)
|
|
433
|
-
-
|
|
434
|
-
- 1.
|
|
435
|
-
- **
|
|
431
|
+
- 40µs
|
|
432
|
+
- 1.5µs
|
|
433
|
+
- **27x**
|
|
436
434
|
* - **Medium JSON** (3.2 KB)
|
|
437
435
|
- 2.1ms
|
|
438
|
-
-
|
|
439
|
-
- **28x**
|
|
440
|
-
* - **Large JSON** (32 KB)
|
|
441
|
-
- 21.5ms
|
|
442
|
-
- 727µs
|
|
436
|
+
- 71µs
|
|
443
437
|
- **30x**
|
|
438
|
+
* - **Large JSON** (32 KB)
|
|
439
|
+
- 21ms
|
|
440
|
+
- 740µs
|
|
441
|
+
- **28x**
|
|
444
442
|
* - **Very Large JSON** (323 KB)
|
|
445
|
-
-
|
|
446
|
-
- 7.
|
|
447
|
-
- **
|
|
443
|
+
- 213ms
|
|
444
|
+
- 7.5ms
|
|
445
|
+
- **28x**
|
|
448
446
|
|
|
449
447
|
**Usage with Rust Extension:**
|
|
450
448
|
|
|
@@ -474,38 +472,54 @@ For other platforms, the pure Python version is used automatically.
|
|
|
474
472
|
Performance Benchmarks
|
|
475
473
|
^^^^^^^^^^^^^^^^^^^^^^
|
|
476
474
|
|
|
477
|
-
Comprehensive benchmarks comparing
|
|
475
|
+
Comprehensive benchmarks comparing all implementations (Apple Silicon, January 2026):
|
|
478
476
|
|
|
479
477
|
.. list-table::
|
|
480
478
|
:header-rows: 1
|
|
481
|
-
:widths:
|
|
479
|
+
:widths: 22 18 15 15 15 15
|
|
482
480
|
|
|
483
481
|
* - Test Case
|
|
484
|
-
- Python
|
|
482
|
+
- Python
|
|
483
|
+
- Rust
|
|
485
484
|
- Go
|
|
486
485
|
- Zig
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
-
|
|
490
|
-
-
|
|
491
|
-
|
|
492
|
-
-
|
|
493
|
-
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
-
|
|
497
|
-
-
|
|
498
|
-
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
-
|
|
502
|
-
-
|
|
486
|
+
- Best
|
|
487
|
+
* - **Small** (47B)
|
|
488
|
+
- 40µs
|
|
489
|
+
- 1.5µs
|
|
490
|
+
- 4.6ms
|
|
491
|
+
- 3.7ms
|
|
492
|
+
- Rust (28x)
|
|
493
|
+
* - **Medium** (3.2KB)
|
|
494
|
+
- 2.1ms
|
|
495
|
+
- 71µs
|
|
496
|
+
- 4.1ms
|
|
497
|
+
- 3.3ms
|
|
498
|
+
- Rust (30x)
|
|
499
|
+
* - **Large** (32KB)
|
|
500
|
+
- 21ms
|
|
501
|
+
- 740µs
|
|
502
|
+
- 4ms
|
|
503
|
+
- 6.1ms
|
|
504
|
+
- Rust (28x)
|
|
505
|
+
* - **Very Large** (323KB)
|
|
506
|
+
- 213ms
|
|
507
|
+
- 7.5ms
|
|
508
|
+
- 4.4ms
|
|
509
|
+
- 33ms
|
|
510
|
+
- Go (48x)
|
|
511
|
+
|
|
512
|
+
**Key Findings:**
|
|
513
|
+
|
|
514
|
+
- **Rust extension**: ~28x faster than Python, zero overhead (best for Python users)
|
|
515
|
+
- **Go CLI**: 48x faster for large files (300KB+), but has ~4ms startup overhead
|
|
516
|
+
- **Zig CLI**: 3-6x faster for medium-large files
|
|
503
517
|
|
|
504
518
|
**Recommendation by Use Case:**
|
|
505
519
|
|
|
506
|
-
- **Python
|
|
507
|
-
- **
|
|
508
|
-
- **
|
|
520
|
+
- **Python library calls**: Use ``pip install json2xml[fast]`` (Rust, 28x faster)
|
|
521
|
+
- **Large file CLI processing**: Use `json2xml-go <https://github.com/vinitkumar/json2xml-go>`_ (Go, 48x for 300KB+)
|
|
522
|
+
- **Pure Python required**: Use ``pip install json2xml``
|
|
509
523
|
|
|
510
524
|
For detailed benchmarks, see `BENCHMARKS.md <https://github.com/vinitkumar/json2xml/blob/master/BENCHMARKS.md>`_.
|
|
511
525
|
|
|
@@ -515,8 +529,9 @@ Other Implementations
|
|
|
515
529
|
|
|
516
530
|
This library is also available in other languages:
|
|
517
531
|
|
|
518
|
-
- **
|
|
519
|
-
- **
|
|
532
|
+
- **Rust**: `json2xml-rs <https://pypi.org/project/json2xml-rs/>`_ - 28x faster, Python extension via PyO3
|
|
533
|
+
- **Go**: `json2xml-go <https://github.com/vinitkumar/json2xml-go>`_ - 48x faster for large files, native CLI
|
|
534
|
+
- **Zig**: `json2xml-zig <https://github.com/vinitkumar/json2xml-zig>`_ - 6x faster, native CLI
|
|
520
535
|
|
|
521
536
|
|
|
522
537
|
Help and Support to maintain this project
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: json2xml
|
|
3
|
-
Version: 6.0.
|
|
3
|
+
Version: 6.0.2
|
|
4
4
|
Summary: Simple Python Library to convert JSON to XML
|
|
5
5
|
Author-email: Vinit Kumar <mail@vinitkumar.me>
|
|
6
6
|
License: Apache Software License 2.0
|
|
@@ -31,6 +31,8 @@ Requires-Dist: coverage
|
|
|
31
31
|
Requires-Dist: setuptools
|
|
32
32
|
Provides-Extra: test
|
|
33
33
|
Requires-Dist: pytest>=8.4.1; extra == "test"
|
|
34
|
+
Provides-Extra: fast
|
|
35
|
+
Requires-Dist: json2xml-rs>=0.1.0; extra == "fast"
|
|
34
36
|
Dynamic: license-file
|
|
35
37
|
|
|
36
38
|
.. image:: ./json2xml-hero.png
|
|
@@ -78,21 +80,19 @@ Installation
|
|
|
78
80
|
|
|
79
81
|
pip install json2xml
|
|
80
82
|
|
|
81
|
-
**With Native Rust Acceleration (
|
|
83
|
+
**With Native Rust Acceleration (28x faster)**
|
|
82
84
|
|
|
83
85
|
For maximum performance, install the optional Rust extension:
|
|
84
86
|
|
|
85
87
|
.. code-block:: console
|
|
86
88
|
|
|
87
|
-
# Install json2xml with Rust acceleration
|
|
89
|
+
# Install json2xml with Rust acceleration
|
|
88
90
|
pip install json2xml[fast]
|
|
89
91
|
|
|
90
92
|
# Or install the Rust extension separately
|
|
91
93
|
pip install json2xml-rs
|
|
92
94
|
|
|
93
|
-
The Rust extension provides **
|
|
94
|
-
|
|
95
|
-
*Note: The ``json2xml-rs`` package will be available on PyPI after the first Rust release.*
|
|
95
|
+
The Rust extension provides **28x faster** conversion compared to pure Python. It's automatically used when available, with seamless fallback to pure Python.
|
|
96
96
|
|
|
97
97
|
**As a CLI Tool**
|
|
98
98
|
|
|
@@ -465,21 +465,21 @@ For users who need maximum performance within Python, json2xml includes an optio
|
|
|
465
465
|
- Rust Extension
|
|
466
466
|
- Speedup
|
|
467
467
|
* - **Small JSON** (47 bytes)
|
|
468
|
-
-
|
|
469
|
-
- 1.
|
|
470
|
-
- **
|
|
468
|
+
- 40µs
|
|
469
|
+
- 1.5µs
|
|
470
|
+
- **27x**
|
|
471
471
|
* - **Medium JSON** (3.2 KB)
|
|
472
472
|
- 2.1ms
|
|
473
|
-
-
|
|
474
|
-
- **28x**
|
|
475
|
-
* - **Large JSON** (32 KB)
|
|
476
|
-
- 21.5ms
|
|
477
|
-
- 727µs
|
|
473
|
+
- 71µs
|
|
478
474
|
- **30x**
|
|
475
|
+
* - **Large JSON** (32 KB)
|
|
476
|
+
- 21ms
|
|
477
|
+
- 740µs
|
|
478
|
+
- **28x**
|
|
479
479
|
* - **Very Large JSON** (323 KB)
|
|
480
|
-
-
|
|
481
|
-
- 7.
|
|
482
|
-
- **
|
|
480
|
+
- 213ms
|
|
481
|
+
- 7.5ms
|
|
482
|
+
- **28x**
|
|
483
483
|
|
|
484
484
|
**Usage with Rust Extension:**
|
|
485
485
|
|
|
@@ -509,38 +509,54 @@ For other platforms, the pure Python version is used automatically.
|
|
|
509
509
|
Performance Benchmarks
|
|
510
510
|
^^^^^^^^^^^^^^^^^^^^^^
|
|
511
511
|
|
|
512
|
-
Comprehensive benchmarks comparing
|
|
512
|
+
Comprehensive benchmarks comparing all implementations (Apple Silicon, January 2026):
|
|
513
513
|
|
|
514
514
|
.. list-table::
|
|
515
515
|
:header-rows: 1
|
|
516
|
-
:widths:
|
|
516
|
+
:widths: 22 18 15 15 15 15
|
|
517
517
|
|
|
518
518
|
* - Test Case
|
|
519
|
-
- Python
|
|
519
|
+
- Python
|
|
520
|
+
- Rust
|
|
520
521
|
- Go
|
|
521
522
|
- Zig
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
-
|
|
525
|
-
-
|
|
526
|
-
|
|
527
|
-
-
|
|
528
|
-
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
-
|
|
532
|
-
-
|
|
533
|
-
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
-
|
|
537
|
-
-
|
|
523
|
+
- Best
|
|
524
|
+
* - **Small** (47B)
|
|
525
|
+
- 40µs
|
|
526
|
+
- 1.5µs
|
|
527
|
+
- 4.6ms
|
|
528
|
+
- 3.7ms
|
|
529
|
+
- Rust (28x)
|
|
530
|
+
* - **Medium** (3.2KB)
|
|
531
|
+
- 2.1ms
|
|
532
|
+
- 71µs
|
|
533
|
+
- 4.1ms
|
|
534
|
+
- 3.3ms
|
|
535
|
+
- Rust (30x)
|
|
536
|
+
* - **Large** (32KB)
|
|
537
|
+
- 21ms
|
|
538
|
+
- 740µs
|
|
539
|
+
- 4ms
|
|
540
|
+
- 6.1ms
|
|
541
|
+
- Rust (28x)
|
|
542
|
+
* - **Very Large** (323KB)
|
|
543
|
+
- 213ms
|
|
544
|
+
- 7.5ms
|
|
545
|
+
- 4.4ms
|
|
546
|
+
- 33ms
|
|
547
|
+
- Go (48x)
|
|
548
|
+
|
|
549
|
+
**Key Findings:**
|
|
550
|
+
|
|
551
|
+
- **Rust extension**: ~28x faster than Python, zero overhead (best for Python users)
|
|
552
|
+
- **Go CLI**: 48x faster for large files (300KB+), but has ~4ms startup overhead
|
|
553
|
+
- **Zig CLI**: 3-6x faster for medium-large files
|
|
538
554
|
|
|
539
555
|
**Recommendation by Use Case:**
|
|
540
556
|
|
|
541
|
-
- **Python
|
|
542
|
-
- **
|
|
543
|
-
- **
|
|
557
|
+
- **Python library calls**: Use ``pip install json2xml[fast]`` (Rust, 28x faster)
|
|
558
|
+
- **Large file CLI processing**: Use `json2xml-go <https://github.com/vinitkumar/json2xml-go>`_ (Go, 48x for 300KB+)
|
|
559
|
+
- **Pure Python required**: Use ``pip install json2xml``
|
|
544
560
|
|
|
545
561
|
For detailed benchmarks, see `BENCHMARKS.md <https://github.com/vinitkumar/json2xml/blob/master/BENCHMARKS.md>`_.
|
|
546
562
|
|
|
@@ -550,8 +566,9 @@ Other Implementations
|
|
|
550
566
|
|
|
551
567
|
This library is also available in other languages:
|
|
552
568
|
|
|
553
|
-
- **
|
|
554
|
-
- **
|
|
569
|
+
- **Rust**: `json2xml-rs <https://pypi.org/project/json2xml-rs/>`_ - 28x faster, Python extension via PyO3
|
|
570
|
+
- **Go**: `json2xml-go <https://github.com/vinitkumar/json2xml-go>`_ - 48x faster for large files, native CLI
|
|
571
|
+
- **Zig**: `json2xml-zig <https://github.com/vinitkumar/json2xml-zig>`_ - 6x faster, native CLI
|
|
555
572
|
|
|
556
573
|
|
|
557
574
|
Help and Support to maintain this project
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "json2xml"
|
|
7
|
-
version = "6.0.
|
|
7
|
+
version = "6.0.2"
|
|
8
8
|
description = "Simple Python Library to convert JSON to XML"
|
|
9
9
|
readme = "README.rst"
|
|
10
10
|
requires-python = ">=3.10"
|
|
@@ -50,11 +50,7 @@ include = ["json2xml"]
|
|
|
50
50
|
test = [
|
|
51
51
|
"pytest>=8.4.1",
|
|
52
52
|
]
|
|
53
|
-
|
|
54
|
-
# For now, install the Rust extension separately:
|
|
55
|
-
# cd rust && pip install -e .
|
|
56
|
-
# Then the dicttoxml_fast module will automatically use the Rust backend.
|
|
57
|
-
# fast = ["json2xml-rs>=0.1.0"]
|
|
53
|
+
fast = ["json2xml-rs>=0.1.0"]
|
|
58
54
|
|
|
59
55
|
[tool.pytest.ini_options]
|
|
60
56
|
testpaths = ["tests"]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|