Registry / serialization / xml-python

xml-python

JSON →
library0.4.3pypypi✓ verified 22d ago

xml-python is a library for making Python objects from XML, designed to parse XML nodes using decorated functions. Last updated in January 2021 (v0.4.3), the project appears to be unmaintained with no public documentation beyond its minimal PyPI description.

pip install xml-python
INSTALL
IMPORT
SIG · XML-PYTHON
X
xml-python
serializationpythonv0.4.3
Install
1.6s avg
Import
115ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.4.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.126s · 18.4MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.104s · 19MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Builder
from xml_python import Builder
from xml_python import xml_objects
Element
from xml_python import Element
ElementTree
from xml_python import ElementTree

This quickstart demonstrates how to define a Python object that maps to an XML structure using `xml-python`'s decorator-based parsing. It defines a `MyNodeObject` class and a `parse_root` function decorated to handle the 'root' XML tag, extracting data from its 'title' and 'text' child nodes.

from xml_python import xml_objects xml_data = """ <root> <title>This is a title</title> <text>This is some text</text> </root> """ # Define a Python class to represent your XML structure class MyNodeObject(xml_objects.XMLObject): pass # Use a decorator to associate the parser function with the 'root' tag @xml_objects.node_parser(MyNodeObject, 'root') def parse_root(parser, node): # Extract data from child nodes parser.title = node.find('title').text parser.text = node.find('text').text # Parse the XML string into the Python object root_object = xml_objects.parse_string(xml_data) print(f"Parsed Title: {root_object.title}") print(f"Parsed Text: {root_object.text}")
Debug
Known issues
gotchaThe `xml-python` library has not been updated since January 2021, and there is no active public repository or detailed documentation available. This may indicate a lack of ongoing maintenance and potential compatibility issues with newer Python versions or security patches.
fix
Evaluate alternatives like `xml.etree.ElementTree` (built-in standard library), `lxml` for performance and advanced features, or `xmltodict` for XML to dictionary conversion, which are actively maintained and well-documented.
affects: <=0.4.3
gotchaWhen parsing XML from untrusted sources, all XML parsing libraries (including standard library modules like `xml.etree.ElementTree` and third-party ones) can be vulnerable to security risks like 'Billion Laughs' or 'XML External Entity (XXE)' attacks. Since `xml-python` lacks clear documentation on its parsing mechanisms and security hardening, it's crucial to exercise caution.
fix
Sanitize XML input from untrusted sources. For critical applications, consider using libraries specifically designed with security in mind (e.g., `defusedxml` which hardens standard library parsers). If possible, validate XML against a schema (XSD) if one is available.
affects: <=0.4.3
Upgrade
Version history
0.4.3latest on PyPI · released Jan 7, 2021
Audit
Dependencies

No dependency data recorded yet.

Agent activity
55 hits · last 30 days
node
44
OpenAI (training)
1
Resources
xml-python — pip install xml-python · libregistry