--- id: pyaml version: "26.7.0" license: WTFPL license_treatment: permissive maintenance: active --- # pyaml — PyYAML-based module to produce a bit more pretty and readable YAML-serialized data License: permissive · Maintenance: active · Downloads: 7.6M/mo ## What it is and what it does pyaml wraps PyYAML to produce YAML output optimized for human reading and editing rather than round-trip fidelity. It applies sensible formatting defaults—unicode support, 100-character width, sorted dict keys, simplified boolean representation—and makes stylistic choices like rendering null values as empty, using literal block scalars for certificates, and adding vertical spacing between sections. The module is designed for serialization only; the description explicitly warns that output may not deserialize exactly as exported and is not guaranteed stable between versions, though representation tweaks can usually be disabled via parameters. It's a small, single-dependency package intended for cases where human-readable YAML output matters more than perfect round-tripping. The author recommends copy-pasting its functionality into projects that only need part of it, rather than adding a dependency for its own sake. Use it for: - Pretty-print configuration files or complex data structures to stdout or files for inspection and manual editing. - Generate human-friendly YAML diffs by sorting keys and controlling formatting to reduce noise in version control. - Debug-print non-trivial Python objects (dicts, dataclasses, enums) as readable YAML during development. - Convert JSON or YAML files to more readable YAML format via the command-line interface. - Format logging or diagnostic output as readable YAML for operational visibility. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Produces human-readable, diff-friendly YAML output from Python data structures using PyYAML as its foundation, with sensible defaults for formatting and readability. Yes, if you need human-readable YAML output and can accept that it prioritizes readability over round-trip fidelity. Low install friction, active maintenance, no known vulnerabilities, and permissive licensing make it a safe choice. Skip it if you require exact deserialization or prefer to use PyYAML directly with explicit parameters. ## Install pip install pyaml uv add pyaml poetry add pyaml ## Installing pyaml Before you install: Low friction: single runtime dependency (PyYAML), pure Python wheel, actively maintained with a release 41 days ago. License in practice: Licensed under WTFPL (permissive), which places no significant restrictions on use or redistribution. Quickstart: pip install pyaml import pyaml data = {'key': 'value', 'nested': {'a': 1, 'b': 2}} pyaml.p(data) Requires Python 3.8 or later. Verify before relying: - Whether output stability guarantees exist across versions (description notes tweaks may change representation). - Whether the module handles all PyYAML-compatible types or has undocumented limitations. ## Package facts - License: WTFPL (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 7.6M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags yaml pretty print, human readable yaml serialization, yaml formatter python, readable yaml dump, yaml output beautifier, pyyaml wrapper, yaml readability tool, yaml-serialization, cli-tool [View on SkillFed](https://skillfed.io/packages/pyaml) · [View on PyPI](https://pypi.org/project/pyaml/)