All Projects → fmenabe → python-yamlordereddictloader

fmenabe / python-yamlordereddictloader

Licence: MIT License
(DEPRECATED) YAML loader and dumper for PyYAML allowing to keep keys order.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to python-yamlordereddictloader

config
Simple configuration management for PHP
Stars: ✭ 15 (-40%)
Mutual labels:  yaml, loader
gsheet to arb
Import translations (ARB/Dart) from Google Sheets
Stars: ✭ 21 (-16%)
Mutual labels:  yaml
pystest
WEB UI自动化测试框架,selenium结合python,测试人员不需要会代码,只需要写配置即可实现,并且方便懂代码的测试人员扩展
Stars: ✭ 24 (-4%)
Mutual labels:  yaml
crack-pro
NEW FACEBOOK COINING TOOL
Stars: ✭ 77 (+208%)
Mutual labels:  dumper
tr4n5l4te
Use Google Translate without an API key.
Stars: ✭ 32 (+28%)
Mutual labels:  yaml
dts-css-modules-loader
A small Webpack loader to generate typings for your CSS-Modules
Stars: ✭ 44 (+76%)
Mutual labels:  loader
LoadersPack-Android
Android LoadersPack - a replacement of default android material progressbar with different loaders
Stars: ✭ 119 (+376%)
Mutual labels:  loader
es2postgres
ElasticSearch to PostgreSQL loader
Stars: ✭ 18 (-28%)
Mutual labels:  loader
dby
Simple Yaml DB
Stars: ✭ 47 (+88%)
Mutual labels:  yaml
odin
Data-structure definition/validation/traversal, mapping and serialisation toolkit for Python
Stars: ✭ 24 (-4%)
Mutual labels:  yaml
php-helpers
A Collection of useful php helper functions.
Stars: ✭ 26 (+4%)
Mutual labels:  yaml
CsharpVoxReader
A generic C# reader for MagicaVoxel's vox file format
Stars: ✭ 15 (-40%)
Mutual labels:  loader
yaask
Make your yaml configurable with interactive configurations!
Stars: ✭ 15 (-40%)
Mutual labels:  yaml
rollup-loader
Rollup does what it can do, and let Webpack finish the job.
Stars: ✭ 86 (+244%)
Mutual labels:  loader
crystalizer
(De)serialize any Crystal object - out of the box. Supports JSON, YAML and Byte format.
Stars: ✭ 32 (+28%)
Mutual labels:  yaml
architectury-api
An intermediary api aimed at easing development of multiplatform mods.
Stars: ✭ 139 (+456%)
Mutual labels:  loader
phaser-webpack-loader
Asset loader for Phaser + Webpack.
Stars: ✭ 85 (+240%)
Mutual labels:  loader
goodconf
Transparently load variables from environment or JSON/YAML file.
Stars: ✭ 80 (+220%)
Mutual labels:  yaml
pyaml env
Parse YAML configuration with environment variables in Python
Stars: ✭ 36 (+44%)
Mutual labels:  yaml
Obsidian-Markdown-Parser
This repository will give you tools to parse and fetch useful informations of your notes in your Obsidian vault.
Stars: ✭ 32 (+28%)
Mutual labels:  yaml

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!

License Versions PyPi Code repo 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

$ pip install yamlordereddictloader

Loader usage

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

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].