ruamel.yaml
ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order
Decision gist · record as of 2026-08-14
Yes, for YAML round-trip use cases. It is the standard choice when you need to preserve comments and formatting during load/dump cycles. Install friction is low and the license is permissive. Caveat: maintenance is aging (224 days since last release), and the maintainer has signaled potential future breaking changes related to PyPI compliance; pin your version and monitor the documentation for updates.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later.
- Optional C extension support (via ruamel.yaml[libyaml] or ruamel.yaml[oldlibyaml]) requires setuptools and a working build toolchain.
- Low friction installation with no runtime dependencies.
License · maintenance · safety
MIT (permissive) — MIT license permits commercial and private use with minimal restrictions; you must include a copy of the license and copyright notice in distributions.
last release 2026-01-02 (224 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 201,323,121 downloads/mo, #204 on PyPI
Alternatives
Verify before relying
pip install ruamel.yaml
from ruamel.yaml import YAML
yaml = YAML()
data = yaml.load(open('config.yaml'))
yaml.dump(data, open('output.yaml', 'w'))- Whether the pending deprecation of YAML(typ='unsafe') will be implemented and when.
- Current status of the PEP 625 compliance issue and potential project name change from ruamel.yaml to ruamel_yaml.
- Whether the Zig-based compilation approach (setuptools-zig) is stable across all advertised platforms and Python versions.
What it is and what it does
ruamel.yaml is a YAML 1.2 parser and emitter that preserves comments, key order, and formatting style during round-trip operations (load then dump). Unlike the standard library's yaml module, it maintains the structure and appearance of YAML documents, making it suitable for configuration files and data that must remain human-readable after processing.
The package has no runtime dependencies in its default form and supports Python 3.9 through 3.14. As of version 0.19.1, it no longer depends on compiled C extensions by default, simplifying installation; optional C-accelerated variants are available via extras (ruamel.yaml[libyaml] or ruamel.yaml[oldlibyaml]) for performance-critical use. The maintainer has flagged potential future breaking changes related to PyPI compliance and API deprecations, so pinning your version is advisable.
Use it for
- Parse and regenerate configuration files while preserving comments and formatting for human review.
- Load YAML data structures and dump them back with original comments and key order intact.
- Build tools and CI/CD systems that need to modify YAML configs without losing readability or structure.
- Applications requiring strict YAML 1.2 compliance and round-trip fidelity for data exchange.
- Limit recursion depth on untrusted YAML input using the .max_depth attribute to prevent denial-of-service attacks.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, for YAML round-trip use cases.
It is the standard choice when you need to preserve comments and formatting during load/dump cycles. Install friction is low and the license is permissive. Caveat: maintenance is aging (224 days since last release), and the maintainer has signaled potential future breaking changes related to PyPI compliance; pin your version and monitor the documentation for updates.
Install
ruamel-yaml on PyPI
Before you install
Low friction installation with no runtime dependencies. Last release was 224 days ago; maintenance status is aging. The package has undergone recent architectural changes (removal of C extension dependencies in 0.19.1) that simplified deployment but may warrant pinning your version.
Requires Python 3.9 or later. Optional C extension support (via ruamel.yaml[libyaml] or ruamel.yaml[oldlibyaml]) requires setuptools and a working build toolchain.
License in practice
MIT license permits commercial and private use with minimal restrictions; you must include a copy of the license and copyright notice in distributions.
Quickstart
pip install ruamel.yaml
from ruamel.yaml import YAML
yaml = YAML()
data = yaml.load(open('config.yaml'))
yaml.dump(data, open('output.yaml', 'w'))
Verify before relying
- Whether the pending deprecation of YAML(typ='unsafe') will be implemented and when.
- Current status of the PEP 625 compliance issue and potential project name change from ruamel.yaml to ruamel_yaml.
- Whether the Zig-based compilation approach (setuptools-zig) is stable across all advertised platforms and Python versions.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Aging 224 days since the last release |
| First released | |
| Downloads | 201,323,121 / month, #204 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonTopic :: Software Development :: Libraries :: Python ModulesTopic :: Text Processing :: MarkupTyping :: Typed |
Evidence: ruamel_yaml-0.19.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “yaml parser round-trip”
- ruamel.yamlLoads and dumps YAML 1.2 with round-trip preservation of comments,…
- ruyamlruyaml is a YAML parser and serializer that preserves comments,…
- ruamel.yaml.jinja2Enables Jinja2 templating within YAML files by preprocessing…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also ruamel.yaml.clib · ruamel.yaml.jinja2 · ruamel.yaml.string · ruyaml · yaml-rs · rapidyaml · pyaml · yamlloader · yamale · yamlordereddictloader