Skip to main content

YAML loader for PyYAML that allow to keep keys order.

Project description

This is a loader for PyYAML allowing to keep items order when loading a file. In some rare cases, it may be desired to keep the order of items when loading the YAML file. For example, this is the case of the clg module (https://pypi.python.org/pypi/clg) that generate a command-line from a dictionnary. When a YAML file is used, and in a purely esthetic purpose, it could be nice to keep order of the items.

The loader is based on stackoverflow topic: http://stackoverflow.com/questions/5121931/in-python-how-can-you-load-yaml-mappings-as-ordereddicts

To install it

$ pip install yamlordereddictload

To use it

import yaml
import yamlordereddictloader

datas = yaml.load(open('myfile.yml'), Loader=yamlordereddictloader.Loader)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yamlordereddictloader-0.1.0.tar.gz (2.6 kB view details)

Uploaded Source

File details

Details for the file yamlordereddictloader-0.1.0.tar.gz.

File metadata

File hashes

Hashes for yamlordereddictloader-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2b82d3573077abc9604fe0e34d6f9172687baf6a7033e2f278b498232da234be
MD5 6749937db96d9d92f1bc9803a01f9520
BLAKE2b-256 a5d6d35221b3102f223d9b8e25d2a85a49d332962820ea40829105ccfc6a94ed

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page