skillfed

yamlloader

Ordered YAML loader and dumper for PyYAML.

yamlloader v1.6.0 294.4K downloads/30d#7,947 on PyPI9
Permissive 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) Active released

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 yamlloader

uv

uv add yamlloader

poetry

poetry add yamlloader

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Science/ResearchIntended Audience :: System AdministratorsLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: LibrariesTopic :: Utilities

Tags

yaml ordered dict loaderpreserve yaml key orderordered yaml dumperpyyaml ordereddictyaml loader with orderyaml file order preservationfast yaml parsing
yaml-serializationdata-format

More Libraries packages