polyxml 0.23.2__tar.gz → 0.24.0__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.
- {polyxml-0.23.2 → polyxml-0.24.0}/Cargo.lock +35 -40
- {polyxml-0.23.2 → polyxml-0.24.0}/Cargo.toml +1 -1
- {polyxml-0.23.2 → polyxml-0.24.0}/PKG-INFO +26 -1
- {polyxml-0.23.2/crates/polyxml-python → polyxml-0.24.0}/README.md +25 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/README.md +15 -12
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/src/codegen/java/mod.rs +8 -8
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/src/codegen/mod.rs +3 -1
- polyxml-0.24.0/crates/polyxml-core/src/codegen/python/aot.rs +295 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/src/codegen/python/mod.rs +15 -2
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/src/codegen/rust/mod.rs +260 -2
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/tests/test_csharp_codegen.rs +8 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/tests/test_python_codegen.rs +153 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/tests/test_rust_codegen.rs +2 -0
- {polyxml-0.23.2 → polyxml-0.24.0/crates/polyxml-python}/README.md +25 -0
- polyxml-0.24.0/crates/polyxml-python/benches/aot_vs_dataclass.py +188 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/pyproject.toml +1 -1
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/Cargo.toml +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/benches/core_benchmarks.rs +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/benches/support/tag_dispatch_fixtures.rs +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/benches/tag_dispatch.rs +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/src/codegen/cpp/mod.rs +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/src/codegen/csharp/mod.rs +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/src/codegen/go/mod.rs +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/src/codegen/java/codec.rs +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/src/codegen/java/models.rs +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/src/codegen/typescript/mod.rs +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/src/converters.rs +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/src/error.rs +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/src/ir/mod.rs +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/src/ir/tarjan.rs +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/src/json.rs +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/src/lib.rs +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/src/parser.rs +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/src/schema.rs +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/src/schema_parser/mod.rs +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/src/serializer.rs +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/src/transcoder.rs +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/src/value.rs +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/tests/test_conformance.rs +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/tests/test_core.rs +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/tests/test_cpp_codegen.rs +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/tests/test_go_codegen.rs +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/tests/test_java_codegen.rs +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/tests/test_json.rs +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/tests/test_pattern_codegen.rs +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/tests/test_rust_codecs.rs +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/tests/test_schema_audit.rs +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/tests/test_schema_ir.rs +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/tests/test_security.rs +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/tests/test_transcoder.rs +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/tests/test_ts_codegen.rs +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-core/tests/test_xsi_type.rs +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-python/Cargo.toml +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-python/src/lib.rs +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-python/tests/test_conformance.py +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-python/tests/test_generated_models.py +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-python/tests/test_json.py +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-python/tests/test_polyxml.py +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/crates/polyxml-python/tests/test_xsi_type.py +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/python/polyxml/AGENT_GUIDE.md +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/python/polyxml/__init__.py +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/python/polyxml/compat/__init__.py +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/python/polyxml/compat/xsdata.py +0 -0
- {polyxml-0.23.2 → polyxml-0.24.0}/python/polyxml/py.typed +0 -0
|
@@ -145,9 +145,9 @@ dependencies = [
|
|
|
145
145
|
|
|
146
146
|
[[package]]
|
|
147
147
|
name = "clap"
|
|
148
|
-
version = "4.6.
|
|
148
|
+
version = "4.6.7"
|
|
149
149
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
150
|
-
checksum = "
|
|
150
|
+
checksum = "aa8876b300ab35ba921adea3dfd70157a46249b33f95c9084ae5709785478946"
|
|
151
151
|
dependencies = [
|
|
152
152
|
"clap_builder",
|
|
153
153
|
"clap_derive",
|
|
@@ -155,9 +155,9 @@ dependencies = [
|
|
|
155
155
|
|
|
156
156
|
[[package]]
|
|
157
157
|
name = "clap_builder"
|
|
158
|
-
version = "4.6.
|
|
158
|
+
version = "4.6.7"
|
|
159
159
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
160
|
-
checksum = "
|
|
160
|
+
checksum = "ec0797fb7aeb1406c84efac526901f7ec3ead2124f946b494e72879d4b54704d"
|
|
161
161
|
dependencies = [
|
|
162
162
|
"anstream",
|
|
163
163
|
"anstyle",
|
|
@@ -167,9 +167,9 @@ dependencies = [
|
|
|
167
167
|
|
|
168
168
|
[[package]]
|
|
169
169
|
name = "clap_derive"
|
|
170
|
-
version = "4.6.
|
|
170
|
+
version = "4.6.7"
|
|
171
171
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
172
|
-
checksum = "
|
|
172
|
+
checksum = "f9c751b79415d4e559e3d1fcf128e09e720eb673a06d26cf6f392d37d75b66e0"
|
|
173
173
|
dependencies = [
|
|
174
174
|
"heck",
|
|
175
175
|
"proc-macro2",
|
|
@@ -474,9 +474,9 @@ dependencies = [
|
|
|
474
474
|
|
|
475
475
|
[[package]]
|
|
476
476
|
name = "napi-build"
|
|
477
|
-
version = "2.
|
|
477
|
+
version = "2.5.0"
|
|
478
478
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
479
|
-
checksum = "
|
|
479
|
+
checksum = "0941983559cd62bfa7f04646a16428967a847365adeef27711e4e3927046bbed"
|
|
480
480
|
|
|
481
481
|
[[package]]
|
|
482
482
|
name = "napi-derive"
|
|
@@ -608,7 +608,7 @@ dependencies = [
|
|
|
608
608
|
|
|
609
609
|
[[package]]
|
|
610
610
|
name = "polyxml"
|
|
611
|
-
version = "0.
|
|
611
|
+
version = "0.24.0"
|
|
612
612
|
dependencies = [
|
|
613
613
|
"criterion",
|
|
614
614
|
"heck",
|
|
@@ -628,14 +628,14 @@ dependencies = [
|
|
|
628
628
|
|
|
629
629
|
[[package]]
|
|
630
630
|
name = "polyxml-c"
|
|
631
|
-
version = "0.
|
|
631
|
+
version = "0.24.0"
|
|
632
632
|
dependencies = [
|
|
633
633
|
"polyxml",
|
|
634
634
|
]
|
|
635
635
|
|
|
636
636
|
[[package]]
|
|
637
637
|
name = "polyxml-cli"
|
|
638
|
-
version = "0.
|
|
638
|
+
version = "0.24.0"
|
|
639
639
|
dependencies = [
|
|
640
640
|
"clap",
|
|
641
641
|
"glob",
|
|
@@ -649,7 +649,7 @@ dependencies = [
|
|
|
649
649
|
|
|
650
650
|
[[package]]
|
|
651
651
|
name = "polyxml-js"
|
|
652
|
-
version = "0.
|
|
652
|
+
version = "0.24.0"
|
|
653
653
|
dependencies = [
|
|
654
654
|
"napi",
|
|
655
655
|
"napi-build",
|
|
@@ -659,7 +659,7 @@ dependencies = [
|
|
|
659
659
|
|
|
660
660
|
[[package]]
|
|
661
661
|
name = "polyxml-python"
|
|
662
|
-
version = "0.
|
|
662
|
+
version = "0.24.0"
|
|
663
663
|
dependencies = [
|
|
664
664
|
"lexical-core",
|
|
665
665
|
"polyxml",
|
|
@@ -669,7 +669,7 @@ dependencies = [
|
|
|
669
669
|
|
|
670
670
|
[[package]]
|
|
671
671
|
name = "polyxml-wasm"
|
|
672
|
-
version = "0.
|
|
672
|
+
version = "0.24.0"
|
|
673
673
|
dependencies = [
|
|
674
674
|
"polyxml",
|
|
675
675
|
"quick-xml",
|
|
@@ -891,11 +891,11 @@ dependencies = [
|
|
|
891
891
|
|
|
892
892
|
[[package]]
|
|
893
893
|
name = "serde_spanned"
|
|
894
|
-
version = "
|
|
894
|
+
version = "1.1.1"
|
|
895
895
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
896
|
-
checksum = "
|
|
896
|
+
checksum = "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26"
|
|
897
897
|
dependencies = [
|
|
898
|
-
"
|
|
898
|
+
"serde_core",
|
|
899
899
|
]
|
|
900
900
|
|
|
901
901
|
[[package]]
|
|
@@ -995,44 +995,42 @@ dependencies = [
|
|
|
995
995
|
|
|
996
996
|
[[package]]
|
|
997
997
|
name = "toml"
|
|
998
|
-
version = "
|
|
998
|
+
version = "1.1.6+spec-1.1.0"
|
|
999
999
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1000
|
-
checksum = "
|
|
1000
|
+
checksum = "920602543f0911ab71da12c50d59701da54c196d1a2bf5cb4b75667f137a406a"
|
|
1001
1001
|
dependencies = [
|
|
1002
|
-
"
|
|
1002
|
+
"indexmap",
|
|
1003
|
+
"serde_core",
|
|
1003
1004
|
"serde_spanned",
|
|
1004
1005
|
"toml_datetime",
|
|
1005
|
-
"
|
|
1006
|
+
"toml_parser",
|
|
1007
|
+
"toml_writer",
|
|
1008
|
+
"winnow",
|
|
1006
1009
|
]
|
|
1007
1010
|
|
|
1008
1011
|
[[package]]
|
|
1009
1012
|
name = "toml_datetime"
|
|
1010
|
-
version = "
|
|
1013
|
+
version = "1.1.1+spec-1.1.0"
|
|
1011
1014
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1012
|
-
checksum = "
|
|
1015
|
+
checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7"
|
|
1013
1016
|
dependencies = [
|
|
1014
|
-
"
|
|
1017
|
+
"serde_core",
|
|
1015
1018
|
]
|
|
1016
1019
|
|
|
1017
1020
|
[[package]]
|
|
1018
|
-
name = "
|
|
1019
|
-
version = "
|
|
1021
|
+
name = "toml_parser"
|
|
1022
|
+
version = "1.1.3+spec-1.1.0"
|
|
1020
1023
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1021
|
-
checksum = "
|
|
1024
|
+
checksum = "1d38ac1cf9b95face32296c0a3ede1fdc270627c9d9c02a7274dd6d960dc4d56"
|
|
1022
1025
|
dependencies = [
|
|
1023
|
-
"indexmap",
|
|
1024
|
-
"serde",
|
|
1025
|
-
"serde_spanned",
|
|
1026
|
-
"toml_datetime",
|
|
1027
|
-
"toml_write",
|
|
1028
1026
|
"winnow",
|
|
1029
1027
|
]
|
|
1030
1028
|
|
|
1031
1029
|
[[package]]
|
|
1032
|
-
name = "
|
|
1033
|
-
version = "
|
|
1030
|
+
name = "toml_writer"
|
|
1031
|
+
version = "1.1.2+spec-1.1.0"
|
|
1034
1032
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1035
|
-
checksum = "
|
|
1033
|
+
checksum = "7d56353a2a665ad0f41a421187180aab746c8c325620617ad883a99a1cbe66d2"
|
|
1036
1034
|
|
|
1037
1035
|
[[package]]
|
|
1038
1036
|
name = "unicode-ident"
|
|
@@ -1155,12 +1153,9 @@ dependencies = [
|
|
|
1155
1153
|
|
|
1156
1154
|
[[package]]
|
|
1157
1155
|
name = "winnow"
|
|
1158
|
-
version = "0.
|
|
1156
|
+
version = "1.0.4"
|
|
1159
1157
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1160
|
-
checksum = "
|
|
1161
|
-
dependencies = [
|
|
1162
|
-
"memchr",
|
|
1163
|
-
]
|
|
1158
|
+
checksum = "23b97319f7b8343df12cc98938e5c3eb436064524c8d2b4e30a1d3a36eecdf81"
|
|
1164
1159
|
|
|
1165
1160
|
[[package]]
|
|
1166
1161
|
name = "yansi"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: polyxml
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.24.0
|
|
4
4
|
Classifier: Development Status :: 4 - Beta
|
|
5
5
|
Classifier: Intended Audience :: Developers
|
|
6
6
|
Classifier: License :: OSI Approved :: MIT License
|
|
@@ -31,12 +31,35 @@ Project-URL: Homepage, https://github.com/polyxml/PolyXML
|
|
|
31
31
|
Project-URL: Issues, https://github.com/polyxml/PolyXML/issues
|
|
32
32
|
Project-URL: Repository, https://github.com/polyxml/PolyXML
|
|
33
33
|
|
|
34
|
+
<p align="center">
|
|
35
|
+
<a href="https://github.com/polyxml/PolyXML">
|
|
36
|
+
<img src="https://raw.githubusercontent.com/polyxml/PolyXML/main/docs/assets/brand/logo_polyxml_banner.png" alt="PolyXML" width="800">
|
|
37
|
+
</a>
|
|
38
|
+
</p>
|
|
39
|
+
|
|
34
40
|
# PolyXML Python Bindings
|
|
35
41
|
|
|
42
|
+
<p align="center">
|
|
43
|
+
<a href="https://pypi.org/project/polyxml/"><img src="https://img.shields.io/pypi/v/polyxml.svg?logo=pypi&label=PyPI" alt="PyPI"></a>
|
|
44
|
+
<a href="https://www.python.org"><img src="https://img.shields.io/badge/Python-3.12%20%7C%203.13%20%7C%203.14%20%7C%203.15-3776AB.svg?logo=python&logoColor=white" alt="Python: 3.12+"></a>
|
|
45
|
+
<a href="https://polyxml.github.io/PolyXML/languages/python/"><img src="https://img.shields.io/badge/docs-zensical-blue.svg" alt="Documentation"></a>
|
|
46
|
+
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT"></a>
|
|
47
|
+
</p>
|
|
48
|
+
|
|
36
49
|
High-performance native XML data-binding engine for Python dataclasses and Pydantic models.
|
|
37
50
|
|
|
38
51
|
Powered by `polyxml-core` written in Rust and PyO3 (`abi3-py312`).
|
|
39
52
|
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Installation
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
pip install polyxml
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
40
63
|
## Features
|
|
41
64
|
|
|
42
65
|
- **⚡ Blazing Fast**: 16x faster deserialization and 38x faster serialization than standard Python tools.
|
|
@@ -44,6 +67,8 @@ Powered by `polyxml-core` written in Rust and PyO3 (`abi3-py312`).
|
|
|
44
67
|
- **📦 Zero-GIL Binary Serialization**: Native `dumps_binary()` and `loads_binary()` using MessagePack (`msgspec`), up to 12.4x faster than pickle.
|
|
45
68
|
- **🎯 Full Type Support**: Dataclasses and Pydantic v2 models with zero boilerplate.
|
|
46
69
|
|
|
70
|
+
---
|
|
71
|
+
|
|
47
72
|
## Quickstart
|
|
48
73
|
|
|
49
74
|
```python
|
|
@@ -1,9 +1,32 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://github.com/polyxml/PolyXML">
|
|
3
|
+
<img src="https://raw.githubusercontent.com/polyxml/PolyXML/main/docs/assets/brand/logo_polyxml_banner.png" alt="PolyXML" width="800">
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
1
7
|
# PolyXML Python Bindings
|
|
2
8
|
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a href="https://pypi.org/project/polyxml/"><img src="https://img.shields.io/pypi/v/polyxml.svg?logo=pypi&label=PyPI" alt="PyPI"></a>
|
|
11
|
+
<a href="https://www.python.org"><img src="https://img.shields.io/badge/Python-3.12%20%7C%203.13%20%7C%203.14%20%7C%203.15-3776AB.svg?logo=python&logoColor=white" alt="Python: 3.12+"></a>
|
|
12
|
+
<a href="https://polyxml.github.io/PolyXML/languages/python/"><img src="https://img.shields.io/badge/docs-zensical-blue.svg" alt="Documentation"></a>
|
|
13
|
+
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT"></a>
|
|
14
|
+
</p>
|
|
15
|
+
|
|
3
16
|
High-performance native XML data-binding engine for Python dataclasses and Pydantic models.
|
|
4
17
|
|
|
5
18
|
Powered by `polyxml-core` written in Rust and PyO3 (`abi3-py312`).
|
|
6
19
|
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pip install polyxml
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
7
30
|
## Features
|
|
8
31
|
|
|
9
32
|
- **⚡ Blazing Fast**: 16x faster deserialization and 38x faster serialization than standard Python tools.
|
|
@@ -11,6 +34,8 @@ Powered by `polyxml-core` written in Rust and PyO3 (`abi3-py312`).
|
|
|
11
34
|
- **📦 Zero-GIL Binary Serialization**: Native `dumps_binary()` and `loads_binary()` using MessagePack (`msgspec`), up to 12.4x faster than pickle.
|
|
12
35
|
- **🎯 Full Type Support**: Dataclasses and Pydantic v2 models with zero boilerplate.
|
|
13
36
|
|
|
37
|
+
---
|
|
38
|
+
|
|
14
39
|
## Quickstart
|
|
15
40
|
|
|
16
41
|
```python
|
|
@@ -1,8 +1,17 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://github.com/polyxml/PolyXML">
|
|
3
|
+
<img src="https://raw.githubusercontent.com/polyxml/PolyXML/main/docs/assets/brand/logo_polyxml_banner.png" alt="PolyXML" width="800">
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
1
7
|
# polyxml
|
|
2
8
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a href="https://crates.io/crates/polyxml"><img src="https://img.shields.io/crates/v/polyxml.svg?logo=rust&label=crates.io" alt="Crates.io"></a>
|
|
11
|
+
<a href="https://docs.rs/polyxml"><img src="https://docs.rs/polyxml/badge.svg" alt="Docs.rs"></a>
|
|
12
|
+
<a href="https://polyxml.github.io/PolyXML/"><img src="https://img.shields.io/badge/docs-zensical-blue.svg" alt="Documentation"></a>
|
|
13
|
+
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT"></a>
|
|
14
|
+
</p>
|
|
6
15
|
|
|
7
16
|
**PolyXML** is a high-performance streaming XML data-binding engine and polyglot schema compiler built in Rust. It serves as the foundational native core powering the `polyxml` CLI and language bindings across Python, C/C++, Java, TypeScript, Go, and C#.
|
|
8
17
|
|
|
@@ -14,7 +23,7 @@
|
|
|
14
23
|
- **Pure-Rust XSD 1.0 & 1.1 Schema Parser**: Parses complex schemas with full support for includes, imports, redefines, choice groups, and restriction facets with zero C dependencies.
|
|
15
24
|
- **Language-Agnostic Schema IR**: Normalizes XML Schema constructs into an actionable, unified Intermediate Representation (`SchemaIR`).
|
|
16
25
|
- **Tarjan SCC Cycle Analysis**: Automatically breaks recursive and mutually cyclic type references with minimal cut points (`Box<T>`, pointers, `std::unique_ptr`, `z.lazy`).
|
|
17
|
-
- **7-Target Code Generator**: Emits idiomatic models and streaming codecs for **Rust**, **Python** (dataclasses & Pydantic v2), **C++20**, **Java
|
|
26
|
+
- **7-Target Code Generator**: Emits idiomatic models and streaming codecs for **Rust**, **Python** (dataclasses & Pydantic v2), **C++20**, **Java 22+**, **TypeScript 5+**, **Go 1.22+**, and **C# 12 / .NET 8+**.
|
|
18
27
|
- **Bidirectional Streaming Codecs**: Fast streaming deserialization and serialization with optional indentation formatting and namespace mapping.
|
|
19
28
|
- **Security Hardened**: Built-in recursion depth limits protect against XML entity expansion and deeply nested denial-of-service (Billion Laughs) attacks.
|
|
20
29
|
- **Zero Heavy Allocations**: Uses `smallvec` and slice lookups to minimize intermediate heap allocations.
|
|
@@ -23,19 +32,13 @@
|
|
|
23
32
|
|
|
24
33
|
## Installation
|
|
25
34
|
|
|
26
|
-
Add `polyxml` to your
|
|
27
|
-
|
|
28
|
-
```toml
|
|
29
|
-
[dependencies]
|
|
30
|
-
polyxml = "0.1.0"
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
Or run:
|
|
35
|
+
Add `polyxml` to your Rust project:
|
|
34
36
|
|
|
35
37
|
```bash
|
|
36
38
|
cargo add polyxml
|
|
37
39
|
```
|
|
38
40
|
|
|
41
|
+
|
|
39
42
|
---
|
|
40
43
|
|
|
41
44
|
## Quickstart
|
|
@@ -18,7 +18,7 @@ use crate::ir::{
|
|
|
18
18
|
/// Target backend for Java code emission.
|
|
19
19
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default, Serialize, Deserialize)]
|
|
20
20
|
pub enum JavaBackend {
|
|
21
|
-
/// Zero-dependency Java
|
|
21
|
+
/// Zero-dependency Java 22+ records (default).
|
|
22
22
|
#[default]
|
|
23
23
|
Standard,
|
|
24
24
|
/// Jackson-annotated records for Spring Boot / enterprise JSON+XML binding.
|
|
@@ -39,14 +39,14 @@ impl JavaBackend {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
/// Options configuring Java
|
|
42
|
+
/// Options configuring Java 22+ code generation.
|
|
43
43
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
44
44
|
pub struct JavaOptions {
|
|
45
45
|
/// Java package declaration for generated types (default: "generated.models")
|
|
46
46
|
pub package_name: String,
|
|
47
47
|
/// Target serialization backend (default: Standard / zero-dependency).
|
|
48
48
|
pub backend: JavaBackend,
|
|
49
|
-
/// Use Java
|
|
49
|
+
/// Use Java 22 `record` instead of traditional classes (default: true)
|
|
50
50
|
pub use_records: bool,
|
|
51
51
|
/// Emit fluent builders for model types.
|
|
52
52
|
#[serde(default)]
|
|
@@ -77,7 +77,7 @@ impl Default for JavaOptions {
|
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
/// Language context adapter for Java
|
|
80
|
+
/// Language context adapter for Java 22+.
|
|
81
81
|
pub struct JavaLanguageContext;
|
|
82
82
|
|
|
83
83
|
impl LanguageContext for JavaLanguageContext {
|
|
@@ -226,7 +226,7 @@ pub fn to_java_enum_constant(name: &str) -> String {
|
|
|
226
226
|
sanitize_keyword(&sanitized, "java")
|
|
227
227
|
}
|
|
228
228
|
|
|
229
|
-
/// Code generator producing Java
|
|
229
|
+
/// Code generator producing Java 22+ records or mutable classes, choices, and enums.
|
|
230
230
|
pub struct JavaCodegen {
|
|
231
231
|
pub options: JavaOptions,
|
|
232
232
|
pub context: JavaLanguageContext,
|
|
@@ -325,11 +325,11 @@ impl JavaCodegen {
|
|
|
325
325
|
}
|
|
326
326
|
out.push_str("// @generated by PolyXML Compiler (https://github.com/polyxml/PolyXML)\n");
|
|
327
327
|
if !self.options.use_records {
|
|
328
|
-
out.push_str("// Target: Java
|
|
328
|
+
out.push_str("// Target: Java 22+ (Mutable JavaBeans)\n\n");
|
|
329
329
|
} else if self.options.backend.is_jackson() {
|
|
330
|
-
out.push_str("// Target: Java
|
|
330
|
+
out.push_str("// Target: Java 22+ (Records, Jackson XML/JSON Annotations)\n\n");
|
|
331
331
|
} else {
|
|
332
|
-
out.push_str("// Target: Java
|
|
332
|
+
out.push_str("// Target: Java 22+ (Records, Sealed Interfaces, Pattern Matching)\n\n");
|
|
333
333
|
}
|
|
334
334
|
|
|
335
335
|
if !self.options.package_name.is_empty() {
|
|
@@ -18,7 +18,9 @@ pub use cpp::{CppBackend, CppCodegen, CppMode, CppOptions};
|
|
|
18
18
|
pub use csharp::{CSharpCodegen, CSharpOptions, CSharpRecordKind};
|
|
19
19
|
pub use go::{GoBackend, GoCodegen, GoOptions};
|
|
20
20
|
pub use java::{JavaBackend, JavaCodegen, JavaOptions};
|
|
21
|
-
pub use python::{
|
|
21
|
+
pub use python::{
|
|
22
|
+
PythonAotCodegen, PythonAotCrate, PythonAotOptions, PythonBackend, PythonCodegen, PythonOptions,
|
|
23
|
+
};
|
|
22
24
|
pub use rust::{RustCodegen, RustOptions};
|
|
23
25
|
pub use typescript::{TypeScriptBackend, TypeScriptCodegen, TypeScriptOptions};
|
|
24
26
|
|