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
File details
Details for the file cascade_config-0.4.0.tar.gz
.
File metadata
- Download URL: cascade_config-0.4.0.tar.gz
- Upload date:
- Size: 14.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb3cffd3e9899b6aa46f29e5462b413cfdd94e74e36748e977d1949c46478715 |
|
MD5 | e9e22d2f16e7b546b1114bfbbddf405d |
|
BLAKE2b-256 | 952c321eaf04f9035c056ed40988357428efffe0e7055dd01566684e6aa856a9 |
File details
Details for the file cascade_config-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: cascade_config-0.4.0-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b2d5825c5b22b10de7e0bf36a056b004a948c6d6d5a3130cb7b692f55d4a67b |
|
MD5 | 07295049a62a44727cef02938bd1dfd8 |
|
BLAKE2b-256 | b76c533f2304e9bbdfc16befa85c6c0ddc6592a2512424350648ae2dd5240f8f |