Skip to main content

parse-xml1

A source-preserving XML 1.0 parser for Python 3.14+, with no runtime dependencies.

python -m pip install parse-xml1
from parse_xml1 import Element, Text, parse

document = parse('<?xml version="1.0"?><greeting lang="en">Hello, XML!</greeting>')
greeting = document.root
assert isinstance(greeting, Element)
assert greeting.name == "greeting"
assert greeting.attributes[0].value == "en"
assert isinstance(greeting.children[0], Text)
assert greeting.to_xml() == '<greeting lang="en">Hello, XML!</greeting>'

The immutable document tree retains the exact original source, including declarations, comments, processing instructions, CDATA sections, whitespace, and entity references. Parsed text and attribute values expose their expanded XML 1.0 values. Internal general entities are supported; external entities and external DTD subsets are never fetched. Parsing has configurable character, node, nesting, and entity-expansion limits.

See the API contract for node types, source spans, limits, and entity handling.

Development

uv sync --locked
uv run --frozen python -m pytest
uv run --frozen python scripts/check_distribution.py --output-dir /tmp/parse-xml1-candidate

The distribution check builds both wheel and source archive and verifies that the installed wheel imports the typed parse_xml1 package.

See release instructions for PyPI Trusted Publishing setup.

Metadata

Release files for parse-xml1 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for parse-xml1 0.1.0
File Size Uploaded Provenance Actions
parse_xml1-0.1.0.tar.gz 13.2 kB With provenance Details for parse_xml1-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for parse-xml1 0.1.0
File Interpreter ABI Platform Actions
parse_xml1-0.1.0-py3-none-any.whl Python 3 none any Details for parse_xml1-0.1.0-py3-none-any.whl

Total release size: 23.6 kB

Release files / parse_xml1-0.1.0.tar.gz

Download URL parse_xml1-0.1.0.tar.gz
Size 13.2 kB
Tags Source
SHA-256 checksum
How to use checksums
9d2e7dbc10e1bb526b389770747ce67df4644ca456f4e08bdd28cae47003f886
BLAKE2b-256 checksum
How to use checksums
8027f9f754cb2a804d4c9e86d5c38942ccec552fd330816162c445954e71af5e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Release files / parse_xml1-0.1.0-py3-none-any.whl

Download URL parse_xml1-0.1.0-py3-none-any.whl
Size 10.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4dc823ab0ae69f2d86ad0d48dd01559347bcb89d2dbd40f870470bef6b302840
BLAKE2b-256 checksum
How to use checksums
afc11615bf00aceba8365e649ce5ce480486c8f6b188cd8b530a8b991cd0feef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Security for parse-xml1 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for parse_xml1-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page