python-yamlloader
Port variant v14
Summary Ordered YAML loader and dumper for PyYAML (3.14)
Package version 1.6.0
Homepage https://github.com/Phynix/yamlloader
Keywords python
Maintainer Python Automaton
License Not yet specified
Other variants v13
Ravenports Buildsheet | History
Ravensource Port Directory | History
Last modified 18 JAN 2026, 19:34:33 UTC
Port created 18 JAN 2026, 19:34:33 UTC
Subpackage Descriptions
single yamlloader ========== This module provides loaders and dumpers for PyYAML. Currently, an OrderedDict loader/dumper is implemented, allowing to keep items order when loading resp. dumping a file from/to an OrderedDict (Python 3.8+: Also regular dicts are supported and are the default items to be loaded to. As of Python 3.7 preservation of insertion order is a language feature of regular dicts.) This project was originally mirrored from [yamlordereddict] Many thanks to the original author François Ménabé! The library contains several improvements including automated testing and the much faster C-versions of the Loaders/Dumpers. [API Documentation] Install ------- There is a pip and a conda version available .. code-block:: bash $ pip install yamlloader or .. code-block:: bash $ conda install yamlloader -c conda-forge But does [your special case here] also work? -------------------------------------------- Tests are run continuously using randomly generated yaml files. Also, there are no fails to be expected. Still, if you are concerned that *your* special case may breaks in the future, please add your own tests as `test_ext_anyname.py` under `tests/` or let us know about your needs. This guarantees that no code will be added that breaks *your* case. C vs non-C version ------------------ A significant speedup can be reached by replacing the Loader* and Dumper* classes by CLoader* and CDumper*. The package hereby relies on the implementations from PyYAML. If they have not been compiled, *yamlloader* **automatically** falls back to the non-C versions. Therefore using the C-version is safe: if it is not available, the pure Python version is automatically used. Usage examples ============== Loader usage ------------ .. code-block:: python import yaml import yamlloader with open('myfile.yml') as yaml_file: data = yaml.load(yaml_file, Loader=yamlloader.ordereddict.CLoader) # CLoader is faster than Loader **Note:** For using the safe loader (which takes standard YAML tags and does not construct arbitrary Python objects), replace ``yamlloader.ordereddict.CLoader by yamlloader.ordereddict.CSafeLoader``. Dumper usage ------------ .. code-block:: python import yaml import yamlloader from collections import OrderedDict data = OrderedDict([('key1', 'val1'), ('key2', OrderedDict([('key21', 'val21'), ('key22', 'val22')]))]) with open('myfile.yaml', 'w') as yaml_file: yaml.dump(data, yaml_file, Dumper=yamlloader.ordereddict.CDumper)
Configuration Switches (platform-specific settings discarded)
PY313 OFF Build using Python 3.13 PY314 ON Build using Python 3.14
Package Dependencies by Type
Build (only) python314:dev:std
python-pip:single:v14
autoselect-python:single:std
Build and Runtime python314:primary:std
Runtime (only) python-PyYAML:single:v14
Download groups
main mirror://PYPIWHL/d2/8a/132113ebc0f5ef3e893c4c75b058f70206b80a8a69ba46fbaeb5d409eb32
Distribution File Information
d9ea9948759732eab65e1dbcea510f1582b9c096aab33c893bf55ae9d58783e8 7804 python-src/yamlloader-1.6.0-py3-none-any.whl
Ports that require python-yamlloader:v14
python-junos-eznc:v14 Junos 'EZ' automation for non-programmers (3.14)