Configpp documentation¶
Summary¶
The configpp is a modular config management library.
- Modules:
- soil: load (and dump) config data from files to simple python object
- tree: define your config with a tree like class structure
- evolution: an alembic like tool for config files
Examples¶
evolution¶
TODO
soil¶
load simple config¶
load_simple.py¶
1 2 3 4 5 6 7 8 |
from configpp.soil import Config
cfg = Config('app.json')
cfg.load()
print(cfg.data)
|
more¶
For more examples please see the unit tests: https://github.com/voidpp/configpp/tree/master/test/test_soil
tree¶
simple attr with default value¶
simple_param_default.py¶
1 2 3 4 5 6 7 8 9 10 11 12 | from configpp.tree import Tree
tree = Tree()
@tree.root()
class Config():
param_simple_1 = 42
cfg = tree.load({})
print(cfg.param_simple_1)
|
more¶
For more examples please see the unit tests: https://github.com/voidpp/configpp/blob/master/test/test_tree/