CLI Config
CLI Config: Lightweight library that provides routines to merge nested and flat configs and set parameters from command line. It is also provide processing functions that can change the whole configuration before and after each config merge, config saving and config loading. It also contains many routines to manipulate the config as flatten or nested dicts.
Make a default config file in your project (configs are merged from left to right):
# main.py
from cliconfig import make_config
config, _ = make_config('default1.yaml', 'default2.yaml') # it's a dict
Then launch your script with additional config(s) file(s) and parameters. By default, these additional configs cannot add new parameters to the default config (for security and retro-compatibility reasons).
python main.py --config first.yaml,second.yaml --param1 1 --subconfig.param2 'foo'
See Quickstart section for more details and Processing section for advanced usage.
- Installation
- Quick start
- Edge cases
- Processing
- CLI Config API
- How to contribute
- License