https://github.com/ralfg/cascade-config
Cascading Python configuration from the CLI and config files
https://github.com/ralfg/cascade-config
argument-parser command-line-interface configuration configuration-files json python toml yaml
Last synced: about 2 months ago
JSON representation
Cascading Python configuration from the CLI and config files
- Host: GitHub
- URL: https://github.com/ralfg/cascade-config
- Owner: RalfG
- License: apache-2.0
- Created: 2020-07-30T19:45:59.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2023-07-03T15:01:13.000Z (almost 3 years ago)
- Last Synced: 2025-11-09T14:14:53.259Z (8 months ago)
- Topics: argument-parser, command-line-interface, configuration, configuration-files, json, python, toml, yaml
- Language: Python
- Homepage: https://cascade-config.readthedocs.io/
- Size: 45.9 KB
- Stars: 0
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# cascade-config
[](https://pypi.org/project/cascade-config)
[](https://github.com/ralfg/cascade-config/releases)
[](https://github.com/ralfg/cascade-config/actions)
[](https://codecov.io/gh/RalfG/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.
```python
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](https://cascade-config.readthedocs.io/en/latest/usage.html) for more
information and examples.
## Contributing
Bugs, questions or suggestions? Feel free to post an issue in the
[issue tracker](https://github.com/RalfG/cascade-config/issues/) or to make a pull
request! See [Contributing](https://cascade-config.readthedocs.io/en/latest/contributing.html)
for more info.
## Changelog
See [Changelog](https://cascade-config.readthedocs.io/en/latest/changelog.html).