--- id: ruyaml version: "0.91.0" license: MIT license license_treatment: permissive maintenance: active --- # ruyaml — ruyaml is a fork of ruamel.yaml License: permissive · Maintenance: active · Downloads: 1.5M/mo ## 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 above — 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 pip install ruyaml uv add ruyaml poetry add ruyaml ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 1.5M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags yaml parser with comments, round-trip yaml serialization, preserve yaml formatting, yaml with comment preservation, ruamel.yaml fork, structured yaml processing, yaml configuration parsing, yaml-parsing, comment-preservation, configuration-management [View on SkillFed](https://skillfed.io/packages/ruyaml) · [View on PyPI](https://pypi.org/project/ruyaml/)