Metadata-Version: 2.4
Name: parse-xml1
Version: 0.1.0
Summary: Source-preserving XML 1.0 parser
Author: wispsy
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3.14
Classifier: Typing :: Typed
Requires-Python: >=3.14
Project-URL: Repository, https://github.com/wispsy/parse-xml1
Project-URL: Issues, https://github.com/wispsy/parse-xml1/issues
Description-Content-Type: text/markdown

# parse-xml1

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

```sh
python -m pip install parse-xml1
```

```python
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](docs/api.md) for node types, source spans, limits, and
entity handling.

## Development

```sh
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](docs/releasing.md) for PyPI Trusted Publishing setup.
