A High-Performance YAML Parser for Python written in Rust
Archived. The repository is read-only: no more fixes or releases will come.
pip install yaml-rsFeatures
- The fastest YAML parser in Python (see benchmarks)
- Full YAML v1.2 spec support
Installation
Using pip:
pip install yaml-rs
Using uv:
uv pip install yaml-rs
Using poetry:
poetry add yaml-rs
Playground
Link: https://lava-sh.github.io/yaml-rs-online
Example
from pprint import pprint
import yaml_rs
yaml = """\
app:
name: service
environment: production
debug: false
version: 1.3.5
log:
level: INFO
file: /var/log/service/app.log
rotation:
enabled: true
max_size_mb: 50
database:
engine: mariadb
host: localhost
port: 3306
username: app_user
password: super_secret_password
pool_size: 10
timeout_seconds: 30
metadata:
author: "John Doe"
created_at: 2024-01-15T12:00:00Z
updated_at: 2025-11-09T10:30:00Z
"""
pprint(yaml_rs.loads(yaml))