python-yamlordereddictloader
Port variant py310
Summary Ordered YAML loader and dump for PyYAML (3.10)
Package version 0.4.2
Homepage https://github.com/fmenabe/python-yamlordereddictloader
Keywords python
Maintainer Python Automaton
License Not yet specified
Other variants v11
Ravenports Buildsheet | History
Ravensource Port Directory | History
Last modified 22 SEP 2023, 16:49:38 UTC
Port created 07 JAN 2023, 04:18:24 UTC
Subpackage Descriptions
single python-yamlordereddictloader ============================ **DEPRECATED: the** `Phynix/yamlloader `_ **project provide an improved version of this library with unit tests, performance improvements (by providing access to the C implementation of PyYAML) and is more actively developed. You should use it!** :alt: License :alt: Versions :alt: PyPi :alt: Code repo :alt: Code Health This module provide a loader and a dumper for PyYAML allowing to keep items order when loading a file (by putting them in OrderedDict objects) and to manage OrderedDict objects when dumping to a file. The loader is based on stackoverflow topic (thanks to Eric Naeseth): http://stackoverflow.com/questions/5121931/in-python-how-can-you-load-yaml-mappings-as-ordereddicts#answer-5121963 Self promotion: I use it a lot with [clg], which allows to generate command-line definition from a configuration file, for keeping order of subcommands, options and arguments in the help message! To install it ------------- .. code-block:: bash $ pip install yamlordereddictloader Loader usage ------------ .. code-block:: python import yaml import yamlordereddictloader data = yaml.load(open('myfile.yml'), Loader=yamlordereddictloader.Loader) **Note:** For using the safe loader (which want standard YAML tags and does not construct arbitrary Python objects), replace ``yamlorderdictloader.Loader by yamlorderedictloader.SafeLoader``. Dumper usage ------------ .. code-block:: python import yaml import yamlordereddictloader from collections import OrderedDict data = OrderedDict([ ('key1', 'val1'), ('key2', OrderedDict([('key21', 'val21'), ('key22', 'val22')])) ]) yaml.dump( data, open('myfile.yml', 'w'), Dumper=yamlordereddictloader.Dumper, default_flow_style=False) **Note:** For using the safe dumper (which produce standard YAML tags and does not represent arbitrary Python objects), replace ``yamlorderdictloader.Dumper by yamlorderedictloader.SafeDumper``.
Configuration Switches (platform-specific settings discarded)
PY310 ON Build using Python 3.10 PY311 OFF Build using Python 3.11
Package Dependencies by Type
Build (only) python-pip:single:py310
autoselect-python:single:standard
Build and Runtime python310:single:standard
Runtime (only) python-PyYAML:single:py310
Download groups
main mirror://PYPIWHL/d3/b6/64e84e26c52343dc48e9ffefd7d5e82b986f3bc2bd6da753420f41645718
Distribution File Information
dc048adb67026786cd24119bd71241f35bc8b0fd37d24b415c37bbc8049f9cd7 4190 yamlordereddictloader-0.4.2-py3-none-any.whl
Ports that require python-yamlordereddictloader:py310
python-junos-eznc:py310 Junos 'EZ' automation for non-programmers (3.10)