skillfed

yamlordereddictloader

YAML loader and dumper for PyYAML allowing to keep keys order.

yamlordereddictloader v0.4.2 429.5K downloads/30d#6,738 on PyPI26
Permissive license MIT License DORMANT released

What it is and what it does

yamlordereddictloader extends pyyaml with custom loaders and dumpers that preserve the order of keys when reading and writing YAML files by storing them in OrderedDict objects. It provides both standard and safe variants—the safe versions work with standard YAML tags and do not construct arbitrary Python objects, while the standard versions offer full Python object support.

The package is a thin wrapper around pyyaml's loader and dumper infrastructure, designed for use cases where maintaining key order through serialization matters. However, the maintainer explicitly marks this project as deprecated and directs users to an improved alternative with unit tests, performance improvements, and more active development.

Use it for:

  • Load YAML configuration files while preserving the order of keys for display in help text or command-line interfaces.
  • Serialize OrderedDict objects back to YAML files with key order intact for human-readable configuration output.
  • Round-trip YAML data (load and dump) in applications where key sequence matters for documentation or UI generation.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides YAML loaders and dumpers for PyYAML that preserve key order by using OrderedDict, allowing round-trip serialization of ordered YAML data.

No. The package is explicitly deprecated by its own maintainer, who recommends an improved alternative. The last release was 1057 days ago, and the project is dormant. Install the recommended replacement instead.

Install

yamlordereddictloader on PyPI

pip

pip install yamlordereddictloader

uv

uv add yamlordereddictloader

poetry

poetry add yamlordereddictloader

Installing yamlordereddictloader

Before you install

Low install friction with a single runtime dependency on pyyaml. Maintenance is dormant—last release was 1057 days ago—and the project's own documentation explicitly recommends switching to an improved alternative instead.

License in practice

MIT License (permissive) places no restrictions on use, modification, or distribution in commercial or private projects.

Quickstart

pip install yamlordereddictloader

import yamlordereddictloader

data = yamlordereddictloader.Loader
# or for safe loading:
data = yamlordereddictloader.SafeLoader

Requires pyyaml to be installed; the package itself is deprecated and its maintainer recommends using an alternative instead.

Verify before relying

  • Whether OrderedDict behavior is still necessary given Python 3.7+ dicts maintain insertion order by default
  • Compatibility with recent pyyaml versions and whether the recommended alternative is a drop-in replacement
  • Performance characteristics compared to the recommended alternative

Package facts

License MIT License (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 1 — pyyaml
Maintenance dormant — 1,057 days since the last release
Last repo commit
First released
Downloads 429,530/month — #6,738 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: yamlordereddictloader-0.4.2-py3-none-any.whl

Keywords: YAML, loader, dumper, ordered, OrderedDict, pyyaml

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: System AdministratorsLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 2.6Programming Language :: Python :: 2.7Programming Language :: Python :: 3Topic :: Utilities

Tags

yaml ordered dict loaderpreserve yaml key orderpyyaml ordereddictyaml loader keep orderordered yaml parsing
yaml-parsingdeprecated

More Utilities packages