v0.1.0: First rock 🪨
🪨 Hello, world! YAMLRocks is here!
This is the very first release of YAMLRocks, a fast, correct, rock-solid YAML library for Python, with a Rust core doing the heavy lifting. (Yes, the R in Rock is for Rust.)
The Python YAML ecosystem has long made you choose: fast (PyYAML's C loader, but YAML 1.1 only, no comments, no round-trip) or rich (ruamel.yaml, but pure Python and slow). YAMLRocks refuses that trade-off.
What you get
- Fast. Roughly 5x to 10x faster parsing than PyYAML's C loader, and 15x to 19x faster serialization. Far more against ruamel.yaml.
- Correct. YAML 1.2 by default, with an opt-in YAML 1.1 compatibility mode.
- Secure by default. Hardened against the common YAML attack classes, with safe loading out of the box.
- Round-trip that respects your file. Comments, anchors, and formatting are preserved, and an unmodified document re-emits byte-for-byte identical. Edit one value, and only that value is rewritten.
- Native includes.
!includeresolution with write-back, so edits land in the right source file. - Annotated mode. Source locations (
__line__,__column__,__file__) on every value, compatible with Home Assistant's annotated YAML. - Batteries included. JSON Schema validation, a PyYAML-compatible shim, rich standard-library type support, the
!secretand!env_varconfig tags, and free-threaded (nogil) readiness.
A taste
import yamlrocks
data = yamlrocks.loads(b"key: value\nlist:\n - 1\n - 2")
# {'key': 'value', 'list': [1, 2]}
yamlrocks.dumps(data)
# b'key: value\nlist:\n - 1\n - 2\n'pip install yamlrocksPrebuilt wheels for Linux, macOS, and Windows across architectures, published via PyPI trusted publishing with build provenance and SBOMs attached.
Tested where it counts
Every release is verified against a reproducible real-world corpus: Home Assistant, ESPHome, Ansible, Kubernetes, Docker Compose, GitHub Actions, CloudFormation, Helm, OpenAPI, dbt, and more. Each of the 22,700 files must parse and round-trip byte-for-byte.
A note on the version
This is 0.1.0, and YAMLRocks is pre-1.0 software. The core promises are already firm: safe loading by default, YAML 1.2 semantics, reproducible real-world verification, and byte-for-byte round-trip for unmodified documents. Some advanced APIs may still shift before 1.0 as the project gathers production feedback. See the stability and roadmap page for the 1.0 contract.
📚 Docs: https://yaml.rocks
Thanks for taking the first rock for a spin. Issues, ideas, and pull requests are very welcome 🪨
../Frenck
 Â
 Â
 Â
 Â
 Â
 Â
 Â
 Â
Blogging my personal ramblings at frenck.dev