Cascading configuration from the CLI and config files.
Project description
cascade-config
Cascading Python configuration from the CLI and multiple config files.
cascade-config simplifies handling multiple configuration sources, such as config files, command line arguments, or even simple dictionaries. Configuration sources can be added one-by-one and will be parsed in hierarchical order, with each new source updating the existing configuration.
Installation
Install with pip
pip install cascade-config
Quickstart
Multiple configuration sources can be added to a cascade_config.CascadeConfig
object. When parsed, each configuration will be added in hierarchical order and update
the existing configuration. The result is a single dictionary containing the cascaded
configuration.
from cascade_config import CascadeConfig
# Setup CascadeConfig instance with JSON schema for validation
cascade_conf = CascadeConfig(validation_schema="config_schema.json")
# Add default and user configurations in cascading order
cascade_conf.add_json("config_default.json")
cascade_conf.add_json("config_user.json")
# Parse the configuration files into a dictionary
config = cascade_conf.parse()
See Usage for more information and examples.
Contributing
Bugs, questions or suggestions? Feel free to post an issue in the issue tracker or to make a pull request! See Contributing for more info.
Changelog
See Changelog.
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
Built Distribution
Hashes for cascade_config-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 770b6d0faad59e2eeda157c61fd62f112c3112c4089b56d3ea022b51e717a329 |
|
MD5 | 06969e233e1aeaf7a5fd5fe6c154c798 |
|
BLAKE2b-256 | 59028547a2db34f20a07ca0ca5ce84c689f2e125a291442ad469767f9532f973 |