Registry / serialization / xml-python

xml-python

JSON →
library0.4.3pypypi✓ verified 33d 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.

serializationdata
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.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18.4MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 1.6s · import 0.000s · 19MB
16MB installed
● package 16MB
Code
Verified usage

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

from xml_python import Builder
from xml_python import Element
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 footguns
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.
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.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
18 hits · last 30 days
gptbot
4
ahrefsbot
4
bytedance
4
script
1
Resources