wrapper for yaml package to read/write OrderedDict
Project description
A wrapper for the yaml module to easily read and write OrderedDict objects to and from YAML formatted files.
Install
pip install yamlord
Usage
The usage is straightforward: make and OrderedDict then write it to a specified path, or read a YAML file from a specified path to an OrderedDict. That’s it.
from collections import OrderedDict
import yamlord
# Make an Ordered dict for testing
d = OrderedDict()
d['a'] = 1
d['b'] = ['str1', 'str2']
# Write OrderedDict to YAML file
yamlord.write_yaml(d, './test.yaml')
# Read YAML file to OrderedDict
d = yamlord.read_yaml('./test.yaml')
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
yamlord-0.4.tar.gz
(2.2 kB
view details)
File details
Details for the file yamlord-0.4.tar.gz
.
File metadata
- Download URL: yamlord-0.4.tar.gz
- Upload date:
- Size: 2.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29fd660c291a0026657e06e2d9839657619eb9ab7591091e7b45691892f26e2e |
|
MD5 | eec80731cbd7f438fcd9d7ff76b14f03 |
|
BLAKE2b-256 | 7e5c1fd0d5740c771314cbf3f6cce2c09b500760937eec650ba6e03ef6ffe0f6 |