skillfed

rapidyaml

Parse and emit YAML, and do it fast. Python wrapper for the C++ library

rapidyaml v0.15.2 261.3K downloads/30d#8,384 on PyPI3
Permissive license MIT Active released

What it is and what it does

Rapidyaml is a Python wrapper around a C++ YAML parser and emitter designed for speed. It exposes a low-level, index-based API that operates on node indices and string views rather than constructing Python dictionaries and lists automatically. All scalar values are returned as untyped strings via memoryview objects, and you must manually walk the tree and convert types as needed. The tradeoff is substantial performance: the package documentation shows parsing speeds 100x and up to 400x faster than alternatives and emitting speeds as high as 3000x faster, though those gains come from avoiding Python-side type conversions and data structure construction.

The package is built on precompiled wheels for modern Python versions across common platforms. It requires you to manage the lifetime of input buffers when using in-place parsing, or to use the arena-based approach for safer operation. The single runtime dependency is deprecation. This is a tool for scenarios where YAML parsing speed is a bottleneck and you can tolerate a lower-level API and manual tree navigation.

Use it for:

  • Parsing large YAML configuration files where speed is critical and you can manually construct Python objects from the tree.
  • Streaming or batch processing of YAML documents in performance-sensitive applications.
  • Emitting YAML at high throughput in data pipelines or real-time systems.
  • Building custom YAML-based serialization layers where you need fine-grained control over tree structure.
  • Embedded or resource-constrained environments where the C++ backend's efficiency matters.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Parses and emits YAML documents via a fast C++ backend, exposing an index-based low-level API that works with node indices and string views rather than building native Python data structures.

Yes, if you need to parse or emit YAML at scale and can work with a low-level index-based API and manual type conversion. No, if you expect automatic Python object construction or need a high-level interface. The package is actively maintained, has no known vulnerabilities, and carries a permissive MIT license.

Install

rapidyaml on PyPI

pip

pip install rapidyaml

uv

uv add rapidyaml

poetry

poetry add rapidyaml

Installing rapidyaml

Before you install

Medium install friction due to compiled wheels; prebuilt binaries available for Python 3.10–3.12 across macOS, Linux, and Windows architectures. Active maintenance with a recent release 50 days ago. Single runtime dependency on deprecation.

License in practice

MIT license permits commercial and private use with minimal restrictions; suitable for most projects.

Quickstart

pip install rapidyaml
import rapidyaml

yaml_bytes = b"{key: value, seq: [0, 1, 2]}"
tree = rapidyaml.parse_in_arena(yaml_bytes)
root_id = tree.root_id()
child_id = tree.find_child(root_id, b"key")
print(tree.val(child_id))

Scalars are returned as memoryview objects to the source buffer; requires explicit encoding conversion to work with Python strings.

Verify before relying

  • Whether the low-level index-based API is suitable for typical YAML workflows or primarily targets performance-critical use cases.
  • Compatibility with YAML specification versions and dialect-specific parsing behavior.
  • Memory overhead of the arena-based approach compared to in-place parsing for large documents.
  • Actual performance gains in real-world applications versus the benchmark scenarios provided.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.6)
Install friction medium — platform-specific wheel
Runtime dependencies 1 — deprecation
Maintenance actively maintained — 50 days since the last release
Last repo commit
First released
Downloads 261,297/month — #8,384 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: rapidyaml-0.15.2-cp310-cp310-macosx_10_9_universal2.whl; rapidyaml-0.15.2-cp310-cp310-macosx_10_9_x86_64.whl; rapidyaml-0.15.2-cp310-cp310-macosx_11_0_arm64.whl; rapidyaml-0.15.2-cp310-cp310-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl; rapidyaml-0.15.2-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; rapidyaml-0.15.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; rapidyaml-0.15.2-cp310-cp310-win32.whl; rapidyaml-0.15.2-cp310-cp310-win_amd64.whl; rapidyaml-0.15.2-cp310-cp310-win_arm64.whl; rapidyaml-0.15.2-cp311-cp311-macosx_10_9_universal2.whl; rapidyaml-0.15.2-cp311-cp311-macosx_10_9_x86_64.whl; rapidyaml-0.15.2-cp311-cp311-macosx_11_0_arm64.whl; rapidyaml-0.15.2-cp311-cp311-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl; rapidyaml-0.15.2-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; rapidyaml-0.15.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; rapidyaml-0.15.2-cp311-cp311-win32.whl; rapidyaml-0.15.2-cp311-cp311-win_amd64.whl; rapidyaml-0.15.2-cp311-cp311-win_arm64.whl; rapidyaml-0.15.2-cp312-cp312-macosx_10_13_universal2.whl; rapidyaml-0.15.2-cp312-cp312-macosx_10_13_x86_64.whl

Operating System :: OS IndependentProgramming Language :: Python :: 3

Tags

fast yaml parseryaml parsing performancec++ yaml library pythonhigh-speed yaml emitteryaml tree traversallow-level yaml api
performance-criticalc-extensionlow-level-api

More Markup packages