yaml-rs
A High-Performance YAML Parser for Python written in Rust
What it is and what it does
yaml-rs is a YAML parser that reads YAML 1.2 formatted text and converts it into Python dictionaries and other native types. It is written in Rust and exposed as a Python extension, trading some install complexity for significantly faster parsing than pure-Python alternatives. The package targets developers who need to parse YAML configuration files, data files, or other YAML content where parsing speed matters or where strict YAML 1.2 compliance is required.
The parser has no runtime dependencies beyond Python itself, making it lightweight once installed. It supports current Python versions (3.10 through 3.15) and is actively maintained. The main trade-off is that installation requires either a prebuilt wheel for your platform or a Rust compiler to build from source; however, wheels cover most common architectures.
Use it for:
- Parse large YAML configuration files where speed is a bottleneck in application startup or reload cycles.
- Process YAML data files in data pipelines where strict YAML 1.2 spec compliance is required.
- Replace PyYAML in projects where YAML 1.1 compatibility issues cause incorrect parsing of certain inputs.
- Load structured YAML documents in CLI tools or services where parsing latency affects user experience.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A high-performance YAML v1.2 parser for Python, implemented in Rust, that parses YAML strings into Python data structures.
Yes, if you need YAML parsing and either require YAML 1.2 spec compliance or want faster parsing than pure-Python libraries. The permissive license, active maintenance, zero runtime dependencies, and broad wheel coverage make it a low-friction upgrade from PyYAML. Install with caution only if your platform lacks a prebuilt wheel and you cannot compile Rust code.
Install
yaml-rs on PyPI
pip
pip install yaml-rsuv
uv add yaml-rspoetry
poetry add yaml-rsInstalling yaml-rs
Before you install
Medium install friction due to compiled Rust bindings, but prebuilt wheels are available for common architectures (x86_64, ARM, RISC-V across Linux, macOS, Windows). Active maintenance with recent releases; last commit 2026-08-14.
License in practice
Licensed under Unlicense (permissive public domain equivalent), imposing no restrictions on use, modification, or distribution.
Quickstart
pip install yaml-rs
import yaml_rs
yaml_string = "app:\n name: service\n debug: false"
data = yaml_rs.loads(yaml_string)
print(data)
Requires Python 3.10 or later; PyPy support is listed but wheel availability may vary by version.
Verify before relying
- Whether the parser handles all edge cases of YAML v1.2 spec in practice, beyond passing the yaml-test-suite.
- Performance benchmarks against other YAML 1.2 parsers in real-world workloads.
- Stability and API compatibility guarantees given the 0.1.6 version number.
Package facts
| License | Unlicense (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 38 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 86,564/month — #13,852 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: yaml_rs-0.1.6-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl; yaml_rs-0.1.6-cp310-cp310-macosx_10_12_x86_64.whl; yaml_rs-0.1.6-cp310-cp310-macosx_11_0_arm64.whl; yaml_rs-0.1.6-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; yaml_rs-0.1.6-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl; yaml_rs-0.1.6-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl; yaml_rs-0.1.6-cp310-cp310-manylinux_2_17_ppc64.manylinux2014_ppc64.whl; yaml_rs-0.1.6-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl; yaml_rs-0.1.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; yaml_rs-0.1.6-cp310-cp310-manylinux_2_31_riscv64.whl; yaml_rs-0.1.6-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl; yaml_rs-0.1.6-cp310-cp310-musllinux_1_2_aarch64.whl; yaml_rs-0.1.6-cp310-cp310-musllinux_1_2_armv7l.whl; yaml_rs-0.1.6-cp310-cp310-musllinux_1_2_i686.whl; yaml_rs-0.1.6-cp310-cp310-musllinux_1_2_ppc64le.whl; yaml_rs-0.1.6-cp310-cp310-musllinux_1_2_riscv64.whl; yaml_rs-0.1.6-cp310-cp310-musllinux_1_2_x86_64.whl; yaml_rs-0.1.6-cp310-cp310-win32.whl; yaml_rs-0.1.6-cp310-cp310-win_amd64.whl; yaml_rs-0.1.6-cp310-cp310-win_arm64.whl
Keywords: yaml, parser
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
ruamel.yamlLoads and dumps YAML 1.2 with round-trip…
permissive · top 1,000 on PyPI
toml-rsA high-performance TOML parser and serializer…
permissive · top 15,000 on PyPI
ruamel.yaml.clibProvides a C-based YAML 1.2 reader, parser, and…
permissive · top 1,000 on PyPI
ruyamlruyaml is a YAML parser and serializer that…
permissive · top 5,000 on PyPI
strictyamlStrictYAML parses and validates YAML documents…
permissive · top 1,000 on PyPI
chalkpy-rsProvides a native Rust extension package that…
unclear · top 15,000 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
PyYAML-ftPyYAML-ft is a YAML parser and emitter for…
permissive · top 5,000 on PyPI
python-frontmatterParses and manages text files with YAML (or…
permissive · top 5,000 on PyPI
YORMYORM maps Python object attributes…
permissive · top 15,000 on PyPI