yamlloader
Ordered YAML loader and dumper for PyYAML.
What it is and what it does
yamlloader extends pyyaml with specialized loaders and dumpers that maintain insertion order when reading and writing YAML files. Since Python 3.7+, regular dicts preserve insertion order as a language feature, and yamlloader leverages this to ensure YAML key order is not lost during serialization and deserialization. The package offers both pure Python and C-accelerated implementations; the C versions are optional—if pyyaml's C extensions are not compiled, yamlloader automatically falls back to pure Python.
The library is designed for workflows where YAML file structure and key ordering matter: configuration files, data interchange, and any scenario where round-tripping YAML through Python objects must preserve the original layout. It depends only on pyyaml and has no other runtime dependencies, making it lightweight to add to existing projects.
Use it for:
- Loading configuration files where key order in YAML reflects priority or logical grouping that must be preserved.
- Round-tripping YAML documents: load, modify in Python, dump back with original key order intact.
- Data serialization workflows requiring deterministic YAML output order for version control or diff readability.
- Scientific or administrative tools that consume structured YAML and need to maintain human-readable key ordering.
- Building YAML-based data pipelines where consistent ordering aids debugging and reproducibility.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides specialized loaders and dumpers for pyyaml that preserve key insertion order when loading and dumping YAML files, with optional C-accelerated versions for improved performance.
Yes. yamlloader is a mature, actively maintained library with no known vulnerabilities, low install friction, and a permissive MIT license. Install it if your workflow requires YAML key order preservation; the automatic C fallback makes it safe across environments. Skip it if you don't care about key ordering or are already using a different ordered YAML solution.
Install
yamlloader on PyPI
pip
pip install yamlloaderuv
uv add yamlloaderpoetry
poetry add yamlloaderInstalling yamlloader
Before you install
Low friction: single runtime dependency on pyyaml, pure Python wheel available. Actively maintained with recent release; C extensions fall back gracefully to pure Python if unavailable, making installation safe across environments.
License in practice
MIT license (permissive). Dual-licensed code includes original work by Jonas Eschle and portions from François Ménabé, both under MIT terms. No restrictions on commercial or private use.
Quickstart
import yamlloader
import pyyaml
with open('myfile.yml') as yaml_file:
data = pyyaml.load(yaml_file, Loader=yamlloader.ordereddict.CLoader)
C version requires libyaml-dev (system library) and Cython for compilation; pure Python fallback is automatic if C extensions unavailable.
Verify before relying
- Whether C extension compilation is reliable across all target Python versions (3.8–3.14) and platforms in typical CI/CD environments.
- Performance gains from C versions relative to pure Python in real-world YAML file sizes and workloads.
- Specific performance improvement magnitude from C-accelerated Loader/Dumper classes versus pure Python versions.
Package facts
| License | Copyright 2017 Jonas Eschle Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — pyyaml |
| Maintenance | actively maintained — 277 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 294,389/month — #7,947 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: yamlloader-1.6.0-py3-none-any.whl
Keywords: PyYAML, dict, dumper, loader, ordered, yaml
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
aspy.yamlProvides order-preserving YAML loading and…
permissive · top 15,000 on PyPI
yamlordereddictloaderProvides YAML loaders and dumpers for PyYAML…
permissive · top 15,000 on PyPI
oyamloyaml is a drop-in replacement for PyYAML that…
permissive · top 5,000 on PyPI
poyoParses a restricted subset of YAML into Python…
permissive · top 15,000 on PyPI
HiYaPyCoLoads and merges multiple YAML configuration…
copyleft · top 15,000 on PyPI
yamlcoreAdds YAML 1.2 Core Schema support to PyYAML,…
permissive · top 15,000 on PyPI
keynote-parserUnpack, edit, and re-pack Apple Keynote .key…
permissive · top 15,000 on PyPI
ordereddictProvides an OrderedDict implementation for…
permissive · top 15,000 on PyPI
saneyamlA lightweight PyYAML wrapper that reads and…
permissive · top 15,000 on PyPI
PyYAML-ftPyYAML-ft is a YAML parser and emitter for…
permissive · top 5,000 on PyPI