polyxml 0.1.0__cp312-abi3-win_amd64.whl
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/__init__.py +44 -0
- polyxml/_polyxml.pyd +0 -0
- polyxml/py.typed +1 -0
- polyxml-0.1.0.dist-info/METADATA +34 -0
- polyxml-0.1.0.dist-info/RECORD +7 -0
- polyxml-0.1.0.dist-info/WHEEL +4 -0
- polyxml-0.1.0.dist-info/sboms/polyxml-python.cyclonedx.json +1288 -0
polyxml/__init__.py
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"""PolyXML: High-performance, polyglot XML data-binding engine."""
|
|
2
|
+
|
|
3
|
+
from polyxml._polyxml import (
|
|
4
|
+
deserialize as _deserialize,
|
|
5
|
+
) # type: ignore[import-not-found]
|
|
6
|
+
from polyxml._polyxml import (
|
|
7
|
+
serialize as _serialize,
|
|
8
|
+
)
|
|
9
|
+
from polyxml._polyxml import (
|
|
10
|
+
version as _version,
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
__version__: str = _version()
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def deserialize[T](source: bytes | str, target_type: type[T]) -> T:
|
|
17
|
+
"""Deserialize XML bytes or string into a Python dataclass or model instance.
|
|
18
|
+
|
|
19
|
+
Args:
|
|
20
|
+
source: XML content as raw bytes or a string.
|
|
21
|
+
target_type: The target dataclass or model class.
|
|
22
|
+
|
|
23
|
+
Returns:
|
|
24
|
+
The deserialized model instance.
|
|
25
|
+
"""
|
|
26
|
+
if isinstance(source, str):
|
|
27
|
+
source = source.encode("utf-8")
|
|
28
|
+
return _deserialize(source, target_type)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def serialize(obj: object, *, indent: int | None = None) -> bytes:
|
|
32
|
+
"""Serialize a strongly-typed model instance back into XML bytes.
|
|
33
|
+
|
|
34
|
+
Args:
|
|
35
|
+
obj: Python dataclass or Pydantic model instance.
|
|
36
|
+
indent: Optional indentation size in spaces for pretty-printing.
|
|
37
|
+
|
|
38
|
+
Returns:
|
|
39
|
+
UTF-8 encoded XML bytes representing the model instance.
|
|
40
|
+
"""
|
|
41
|
+
return _serialize(obj, indent=indent)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
__all__ = ["__version__", "deserialize", "serialize"]
|
polyxml/_polyxml.pyd
ADDED
|
Binary file
|
polyxml/py.typed
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Marker file for PEP 561
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: polyxml
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Classifier: Development Status :: 4 - Beta
|
|
5
|
+
Classifier: Intended Audience :: Developers
|
|
6
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
7
|
+
Classifier: Programming Language :: Rust
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
11
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
12
|
+
Classifier: Topic :: Text Processing :: Markup :: XML
|
|
13
|
+
Classifier: Typing :: Typed
|
|
14
|
+
Requires-Dist: pytest>=8.0.0 ; extra == 'dev'
|
|
15
|
+
Requires-Dist: pytest-cov>=5.0.0 ; extra == 'dev'
|
|
16
|
+
Requires-Dist: pydantic>=2.7.0 ; extra == 'dev'
|
|
17
|
+
Requires-Dist: ruff>=0.4.0 ; extra == 'dev'
|
|
18
|
+
Provides-Extra: dev
|
|
19
|
+
Summary: High-performance, polyglot XML data-binding engine built in Rust
|
|
20
|
+
Author-email: Bailey Nguyen <bailey.tan.nguyen@gmail.com>
|
|
21
|
+
License: MIT
|
|
22
|
+
Requires-Python: >=3.12
|
|
23
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
24
|
+
Project-URL: Documentation, https://nth-bailey.github.io/PolyXML/
|
|
25
|
+
Project-URL: Homepage, https://github.com/nth-bailey/PolyXML
|
|
26
|
+
Project-URL: Issues, https://github.com/nth-bailey/PolyXML/issues
|
|
27
|
+
Project-URL: Repository, https://github.com/nth-bailey/PolyXML
|
|
28
|
+
|
|
29
|
+
# PolyXML Python Bindings
|
|
30
|
+
|
|
31
|
+
High-performance native XML data-binding engine for Python dataclasses and Pydantic models.
|
|
32
|
+
|
|
33
|
+
Powered by polyxml-core written in Rust and PyO3 (abi3-py312).
|
|
34
|
+
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
polyxml/__init__.py,sha256=9RCe5ERmle7kzjxp_YGsp1YeVlqwkPecqqUxoa5BcIk,1240
|
|
2
|
+
polyxml/_polyxml.pyd,sha256=uLOtkAdfMFXPyAX6WWI1xQGxrKpadvjR_oOq4dqaZmY,320000
|
|
3
|
+
polyxml/py.typed,sha256=8PjyZ1aVoQpRVvt71muvuq5qE-jTFZkK-GLHkhdebmc,26
|
|
4
|
+
polyxml-0.1.0.dist-info/METADATA,sha256=fe_5xMPvdzdGBCaCJ4uWmQqBK3uMu9yuYSxryNepbGY,1421
|
|
5
|
+
polyxml-0.1.0.dist-info/WHEEL,sha256=rjikdQI6uHLAgYXPVkr7bTnnX2G_U4MjYuRag5dSWZs,96
|
|
6
|
+
polyxml-0.1.0.dist-info/sboms/polyxml-python.cyclonedx.json,sha256=1PscoR16hwAC_BuVy4yOqxHuAw1sm0R7nnQn12zHQP8,39920
|
|
7
|
+
polyxml-0.1.0.dist-info/RECORD,,
|