Metadata-Version: 2.4
Name: parse-yaml
Version: 0.1.0
Summary: Bounded YAML 1.2 subset parsing for Python
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-yaml
Project-URL: Issues, https://github.com/wispsy/parse-yaml/issues
Description-Content-Type: text/markdown

# parse-yaml

Bounded YAML 1.2 core-schema subset parsing for Python 3.14+, with no runtime
dependencies.

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

```python
from parse_yaml import parse

document = parse("""
name: Ada
active: true
roles:
  - admin
  - editor
""")

assert document.value == {
    "name": "Ada",
    "active": True,
    "roles": ["admin", "editor"],
}
assert document.to_yaml().startswith("\nname: Ada")
```

`parse()` returns a typed `Document` with the parsed Python value, original
source, and a source span. `loads()` returns only the value. Mapping keys are
strings, and duplicate keys, invalid input, and unsupported YAML constructs
raise `ParseError` with a line and column.

The parser supports block mappings and sequences, flow mappings and sequences,
single- and double-quoted scalars, comments, and YAML 1.2 core null, boolean,
integer, and finite floating-point values. It intentionally does not implement
all of YAML; see the [supported syntax and API contract](docs/api.md).

Development and distribution checks:

```sh
uv sync
uv run python -m pytest
uv run python scripts/check_distribution.py --output-dir /tmp/parse-yaml-candidate
```

## Releasing

Releases are published from `main` by pushing a `v`-prefixed tag matching the
version in `pyproject.toml` (for example, `v0.1.0`). The release workflow checks
that the tagged commit is on `main` and that the tag matches the package version
before publishing the verified distributions.

Before the first release, configure the GitHub Actions environment `pypi` and
add a Trusted Publisher to the PyPI project `parse-yaml` with owner `wispsy`,
repository `parse-yaml`, workflow filename `release.yaml`, and environment
`pypi`. Publishing uses Trusted Publishing; no PyPI API token is required.
