--- id: yamlloader version: "1.6.0" 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) license_treatment: permissive maintenance: active --- # yamlloader — Ordered YAML loader and dumper for PyYAML. License: permissive · Maintenance: active · Downloads: 294.4K/mo ## 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 above — 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 pip install yamlloader uv add yamlloader 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_current - Install friction: low - Maintenance: active - Downloads: 294.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags yaml ordered dict loader, preserve yaml key order, ordered yaml dumper, pyyaml ordereddict, yaml loader with order, yaml file order preservation, fast yaml parsing, yaml-serialization, data-format [View on SkillFed](https://skillfed.io/packages/yamlloader) · [View on PyPI](https://pypi.org/project/yamlloader/)