Skip to content

Installation

Installation

Requirements

Requirement Details
Python ≥ 3.8 (CPython), including 3.14t free-threaded
Platform Linux, macOS, Windows
Build Rust toolchain (for source builds only)

Install from PyPI

The package is published on PyPI. Install with pip:

Install from PyPI
pip install pyrs-yaml

The package is built as an ABI3 wheel, meaning a single wheel works across Python 3.8 through 3.15 — no recompilation needed.

Install from Source

For development or the latest unreleased changes:

Install from source
git clone https://github.com/759401524/pyrs-yaml.git
cd pyrs-yaml
uv run --frozen maturin develop --release

Free-Threaded Python (cp314t)

Free-threaded (no-GIL) wheels for CPython 3.14t include the NumPy integration. When NumPy is installed in the environment, safe_dump / from_dict serialize numpy.ndarray values normally; when NumPy is absent, the integration is inert and calls fall through to the default object handler. GIL builds (Python 3.8–3.15) keep full ndarray serialization support.

NumPy is auto-detected at runtime

The NumPy integration is compiled in on every wheel (GIL and free-threaded) but only activates when NumPy is importable. If NumPy is not installed, safe_dump on a numpy.ndarray raises YamlTypeError (the value is not a recognized type).

Quick Check

Verifying your install

Run the snippet below to confirm the module imports, the version is reported, and a basic parse/round-trip works. A successful run prints ✓ Installation verified.

Verify your install
import pyrs_yaml

# Check version
print(pyrs_yaml.__version__)

# Quick smoke test
doc = pyrs_yaml.parse("key: value")
assert doc.to_yaml() == "key: value\n"
print("✓ Installation verified")

Run Tests

cargo nextest run --all
uv run --frozen pytest tests/