A config util package to flatten-reduce long keys
Project description
Config (YAML/JSON) Keys Flatten-Reducer
conduce - A simple config package which flatten-reduces all keys of either a YAML or JSON config
to allow a simple way to get values from long keys.
some.yaml:
alpha:
beta:
gamma: "hello"
some.json:
{"alpha": {"beta": {"gamma": "world"}}}
some_deep_nested.yaml:
alpha:
beta:
gamma:
delta:
theta:
phi:
"finally!!!"
example.py:
from conduce import conduce
c1 = conduce.read_yaml("some.yaml", "some/path/to/the/yaml")
c2 = conduce.read_json("some.json", "some/path/to/the/json")
c3 = conduce.read_yaml("some_deep_nested.yaml", "some/path/to/the/yaml")
c1('alpha.beta.gamma') # returns value "hello"
c2('alpha.beta.gamma') # returns value "world"
c3('alpha.beta.gamma.delta.theta.phi') # returns value "finally!!!"
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
conduce-0.0.3.tar.gz
(3.0 kB
view hashes)