Cascading configuration manager and logger for python (yaml, json)
Bole = "trunk of a tree" = "log" :)
Bole is a python configuration manager that has,
- Loads configurations from
yaml, json
- Allows inheritance - child folder can load config from parent folder.
- Allows imports - allows specifying config loading paths (and globs)
- Has an easy to use cli.
Just install the pip package,
pip install bole
settings:
inherit: True # If true, allow inherit parent folders.
environments:
test:
my_value: 22
dev:
my_value: 42
my_value: 0
some_col:
a:
- b: 0
To view this configuration just run (in the config folder),
bole config view
To get the result of my_value
, run,
bole config get my_value # or
bole config get some_col.a[0].b
The following keywords are reserved (default values presented)
settings:
inherit: False # If true, allow inherit parent folders.
inherit_siblings: True # If true allow inherit configuration files in the same source directory.
allow_imports: True # If false dose not allow imports.
use_deep_merge: True # Merge configurations via deep merge. If false, Only root keys are merged (and overwritten)
concatenate_lists: True # When merging, append the merged list to the current one.
imports:
- "**/*.config.yaml" # Recursively import all .config.yaml
- path: my-config.yaml
required: False # this item is not required.
recursive: null # Applies if glob. Import recursively.
environments:
[env name]:{ config overrides (any) }
Example configuration with inheritance can be found in tests.
Feel free to ping me in issues or directly on LinkedIn to contribute.
We plan to support multiple python version per environment.
Looking for help on this subject.
Copyright ©
Zav Shotan
and other contributors.
It is free software, released under the MIT licence, and may be redistributed under the terms specified in LICENSE
.