ruyaml
ruyaml is a fork of ruamel.yaml
What it is and what it does
ruyaml is a maintained fork of ruamel.yaml that parses and serializes YAML while preserving comments, blank lines, and formatting during round-trip operations. It's designed to solve the problem of YAML libraries that lose structural metadata when loading and re-saving files—critical for configuration management, templating, and any workflow where human-readable YAML structure matters.
The package provides a YAML() class-based API (replacing deprecated top-level functions) and depends only on distro and setuptools. It supports Python 3.6 through 3.10 and is actively maintained by the pycontribs community to ensure long-term stability. The fork was created to secure the library's future by distributing maintenance responsibilities.
Use it for:
- Editing and updating configuration files while preserving comments and formatting for human readability
- Building YAML-based templating or code generation systems that need to maintain structural integrity
- Loading YAML data with comments and re-serializing it without losing metadata for documentation or audit trails
- Configuration management tools that must preserve user comments and formatting across updates
- Parsing structured YAML documents where comment preservation is required for compliance or clarity
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
ruyaml is a YAML parser and serializer that preserves comments, formatting, and structure during round-trip load/dump cycles, designed as a maintained fork of ruamel.yaml.
Yes, with conditions. ruyaml is production-stable (MIT license, actively maintained repository, no known vulnerabilities, low install friction) and solves a real problem that standard YAML libraries don't—preserving comments and formatting. However, the last PyPI release was December 2021 despite recent repository commits; verify that the version available on PyPI meets your needs, or consider pinning to a specific version if you depend on recent fixes.
Install
ruyaml on PyPI
pip
pip install ruyamluv
uv add ruyamlpoetry
poetry add ruyamlInstalling ruyaml
Before you install
Low install friction with only two runtime dependencies (distro and setuptools). The package is actively maintained with recent commits and a stable release history, though the last PyPI release was in December 2021 despite ongoing repository activity.
License in practice
MIT license (permissive) means you can use, modify, and distribute this package freely in both open-source and proprietary projects with minimal restrictions.
Quickstart
pip install ruyaml
import ruyaml as yaml
yaml_obj = yaml.YAML()
data = yaml_obj.load(open('config.yaml'))
yaml_obj.dump(data, open('output.yaml', 'w'))
Requires Python 3.6 or later; the old top-level functions (load, dump, safe_load, etc.) are deprecated—use YAML() instance methods instead.
Verify before relying
- Current maintenance status relative to the original ruamel.yaml—whether ruyaml is actively receiving feature parity updates
- Specific performance characteristics compared to ruamel.yaml or PyYAML for large YAML files
- Whether the package is suitable for production use given the last PyPI release was December 2021
Package facts
| License | MIT license (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — distro, setuptools |
| Maintenance | actively maintained — 1,711 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,495,051/month — #3,838 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: ruyaml-0.91.0-py3-none-any.whl
Keywords: selinux, virtualenv
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
ruamel.yamlLoads and dumps YAML 1.2 with round-trip…
permissive · top 1,000 on PyPI
yaml-rsA high-performance YAML v1.2 parser for Python,…
permissive · top 15,000 on PyPI
ruamel.yaml.clibProvides a C-based YAML 1.2 reader, parser, and…
permissive · top 1,000 on PyPI
ruamel.yaml.stringAdds a `dump_to_string` method to…
permissive · top 15,000 on PyPI
ruamel.yaml.jinja2Enables Jinja2 templating within YAML files by…
permissive · top 5,000 on PyPI
yamlpathQuery, retrieve, update, merge, validate, and…
permissive · top 15,000 on PyPI
sphinxcontrib-autoyamlA Sphinx extension that auto-generates…
permissive · top 15,000 on PyPI
yamlfixyamlfix is a command-line YAML formatter that…
copyleft · top 5,000 on PyPI
pyamlProduces human-readable, diff-friendly YAML…
permissive · top 5,000 on PyPI
strictyamlStrictYAML parses and validates YAML documents…
permissive · top 1,000 on PyPI