skillfed

oyaml

Ordered YAML: drop-in replacement for PyYAML which preserves dict ordering

oyaml v1.0 2.7M downloads/30d#2,934 on PyPI185
Permissive license MIT DORMANT released

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 oyaml

uv

uv add oyaml

poetry

poetry add oyaml

Installing 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

yaml dict orderingordered yaml parsingpyyaml replacementpreserve yaml key orderyaml mapping orderordered yaml dumpyaml dict preservation
yamlserialization

More Markup packages