oyaml
Ordered YAML: drop-in replacement for PyYAML which preserves dict ordering
What it is and what it does
oyaml wraps PyYAML to preserve the order of keys in dictionaries during YAML serialization and deserialization. In scenarios where standard PyYAML could scramble dictionary key order, oyaml maintains insertion order throughout the round-trip. You import it as a drop-in replacement (import oyaml as yaml) and use it identically to PyYAML.
The package depends only on pyyaml and installs as a pure-Python wheel, making setup trivial. It is dormant—last released in 2020-08-18 with no recent commits—so it receives no active development or bug fixes. This matters most if you rely on it with newer PyYAML versions or encounter edge cases that require upstream fixes.
Use it for:
- Preserving YAML key order in configuration files where the sequence of settings matters for readability
- Round-tripping YAML data structures without losing the original key ordering
- Ensuring consistent, predictable YAML dumps for version control or diff-friendly configuration management
- Legacy codebases that need ordered YAML output before dict ordering became standard
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
oyaml is a drop-in replacement for PyYAML that preserves dictionary ordering when dumping and loading YAML, eliminating scrambled key order.
Yes-with-conditions. Install if you need ordered YAML output and cannot rely on standard PyYAML. Be aware the package is unmaintained since 2020-08-18 and may not work reliably with recent PyYAML releases. If you can use modern Python versions where dict ordering is guaranteed, standard PyYAML may suffice.
Install
oyaml on PyPI
pip
pip install oyamluv
uv add oyamlpoetry
poetry add oyamlInstalling oyaml
Before you install
Installation is straightforward with low friction—a pure-Python wheel with a single runtime dependency on pyyaml. However, the package is dormant: the latest release was 2020-08-18, and no commits have landed since 2024-11-05, so it receives no active maintenance.
License in practice
MIT is a permissive license with minimal restrictions, allowing commercial and private use without obligation to share modifications.
Quickstart
pip install oyaml
import oyaml as yaml
data = yaml.safe_load(open('config.yaml'))
yaml.safe_dump(data)
Verify before relying
- Whether dict ordering preservation is still necessary given Python 3.7+ guarantees insertion order for built-in dicts
- Compatibility with recent PyYAML versions and modern Python releases beyond what the fact sheet specifies
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — pyyaml |
| Maintenance | dormant — 2,187 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,703,010/month — #2,934 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: oyaml-1.0-py2.py3-none-any.whl
Tags
More Markup packages
PyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
markdown-it-pyA Python markdown parser that converts markdown…
permissive · top 100 on PyPI
beautifulsoup4Beautiful Soup parses HTML and XML documents…
permissive · top 100 on PyPI
et-xmlfileet_xmlfile writes large XML files with minimal…
permissive · top 1,000 on PyPI
tomlkitParses and edits TOML files while preserving…
permissive · top 1,000 on PyPI
docstring-parserParses Python docstrings in ReST, Google,…
permissive · top 1,000 on PyPI
aspy.yamlProvides order-preserving YAML loading and…
permissive · top 15,000 on PyPI
saneyamlA lightweight PyYAML wrapper that reads and…
permissive · top 15,000 on PyPI
yamlloaderProvides specialized loaders and dumpers for…
permissive · top 15,000 on PyPI
yamlordereddictloaderProvides YAML loaders and dumpers for PyYAML…
permissive · top 15,000 on PyPI
pyamlProduces human-readable, diff-friendly YAML…
permissive · top 5,000 on PyPI
HyperPyYAMLExtends YAML syntax with Python-friendly…
permissive · top 5,000 on PyPI
yamlableConverts Python objects to YAML and back using…
permissive · top 15,000 on PyPI
yaml-rsA high-performance YAML v1.2 parser for Python,…
permissive · top 15,000 on PyPI
PyYAML-ftPyYAML-ft is a YAML parser and emitter for…
permissive · top 5,000 on PyPI