Ordered value getter from Dictionary type value.
Project description
Ordered value getter from Dictionary type value.
Requirements
Python 2.6 upper and 3.x
From a dictionary type, this can acquire a value in order of a methodical keys.
Example
QuickStart
import OrderedFormat as odf yml_data = """ human: name: John age: 22 """ key_data = """ human: - name - age - name """ ordered_keys = odf.get_ordered_keys(key_data=key_data, ext="yml") ordered_data = odf.kflatten(yml_data, ordered_keys, type="yaml") # ordered_data = ("John", "John", 22, "John")
Currentry, kflatten method return flat tuple value.
When you load keys value or dict value (json/yaml file type), you can use two method.
Using Load File Data
ordered_keys = odf.load_ordered_keys(key_data=None, filename="<keys_file.json | keys_file.yaml>") dict_data = odf.load_dict_val("<dict_file.json | dict_file.yaml>") odf.kflatten(dict_data, ordered_keys)
Available extension is “.yaml” , “.yml” and “json”.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
OrderedFormat-0.0.1.tar.gz
(5.0 kB
view hashes)
Built Distribution
Close
Hashes for OrderedFormat-0.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d81c84c958814ca538d405caa5471cc8e4a259f96306b42d21e00dcb468d09e5 |
|
MD5 | eb98d6379d600257c097d4f0c14f2577 |
|
BLAKE2b-256 | 61ea6f98055ab19c1f59d494a91dfead3e166d056204983fcefd7c36cff86527 |