Ordered value getter from Dictionary type value.
Project description
Ordered value getter from Dictionary type value.
Requirements
Python 2.7 upper and 3.x
From a dictionary type, this can acquire a value in order of a methodical keys.
Install
pip install OrderedFormat
Usage
QuickStart
import OrderedFormat.formatter as odf yml_txt_data = """ human: name: John age: 22 """ yml_key_txt = """ human: - name - age - name """ ordered_keys = odf.load_ordered_keys(None, raw_txt=yml_key_txt, load_type="yaml") ordered_data = odf.kflatten(yml_txt_data, ordered_keys, load_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("<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.2.tar.gz
(5.2 kB
view hashes)
Built Distribution
Close
Hashes for OrderedFormat-0.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | da0dbd8e60ff136746bee9be03398151ff0a581c71988cff0c6a94a41a464f9c |
|
MD5 | 21748f2ac7e0440c3f7f8a4c398283a7 |
|
BLAKE2b-256 | 5f2a7c9047d65cb72af9036660236a72a278f4e3544b0b8fa190d72577cec773 |