# cascade-config
[![](https://flat.badgen.net/pypi/v/cascade-config?icon=pypi)](https://pypi.org/project/cascade-config)
[![](https://flat.badgen.net/github/release/ralfg/cascade-config)](https://github.com/ralfg/cascade-config/releases)
[![](https://flat.badgen.net/github/checks/ralfg/cascade-config/)](https://github.com/ralfg/cascade-config/actions)
[![](https://flat.badgen.net/codecov/c/github/ralfg/cascade-config)](https://codecov.io/gh/RalfG/cascade-config)
![](https://flat.badgen.net/github/last-commit/ralfg/cascade-config)
![](https://flat.badgen.net/github/license/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).
Raw data
{
"_id": null,
"home_page": "",
"name": "cascade-config",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "configuration,command line interface,configuration files,JSON",
"author": "",
"author_email": "Ralf Gabriels <ralf@gabriels.dev>",
"download_url": "https://files.pythonhosted.org/packages/95/2c/321eaf04f9035c056ed40988357428efffe0e7055dd01566684e6aa856a9/cascade_config-0.4.0.tar.gz",
"platform": null,
"description": "# cascade-config\n\n[![](https://flat.badgen.net/pypi/v/cascade-config?icon=pypi)](https://pypi.org/project/cascade-config)\n[![](https://flat.badgen.net/github/release/ralfg/cascade-config)](https://github.com/ralfg/cascade-config/releases)\n[![](https://flat.badgen.net/github/checks/ralfg/cascade-config/)](https://github.com/ralfg/cascade-config/actions)\n[![](https://flat.badgen.net/codecov/c/github/ralfg/cascade-config)](https://codecov.io/gh/RalfG/cascade-config)\n![](https://flat.badgen.net/github/last-commit/ralfg/cascade-config)\n![](https://flat.badgen.net/github/license/ralfg/cascade-config)\n\n\n*Cascading Python configuration from the CLI and multiple config files.*\n\ncascade-config simplifies handling multiple configuration sources, such as config files, command line arguments, or even simple dictionaries. Configuration sources can be added\none-by-one and will be parsed in hierarchical order, with each new source updating the\nexisting configuration.\n\n## Installation\n\nInstall with pip\n```\npip install cascade-config\n```\n\n## Quickstart\n\nMultiple configuration sources can be added to a `cascade_config.CascadeConfig`\nobject. When parsed, each configuration will be added in hierarchical order and update\nthe existing configuration. The result is a single dictionary containing the cascaded\nconfiguration.\n\n```python\nfrom cascade_config import CascadeConfig\n\n# Setup CascadeConfig instance with JSON schema for validation\ncascade_conf = CascadeConfig(validation_schema=\"config_schema.json\")\n\n# Add default and user configurations in cascading order\ncascade_conf.add_json(\"config_default.json\")\ncascade_conf.add_json(\"config_user.json\")\n\n# Parse the configuration files into a dictionary\nconfig = cascade_conf.parse()\n```\n\nSee [Usage](https://cascade-config.readthedocs.io/en/latest/usage.html) for more\ninformation and examples.\n\n\n## Contributing\n\nBugs, questions or suggestions? Feel free to post an issue in the\n[issue tracker](https://github.com/RalfG/cascade-config/issues/) or to make a pull\nrequest! See [Contributing](https://cascade-config.readthedocs.io/en/latest/contributing.html)\nfor more info.\n\n\n## Changelog\n\nSee [Changelog](https://cascade-config.readthedocs.io/en/latest/changelog.html).\n\n",
"bugtrack_url": null,
"license": "",
"summary": "Cascading configuration from the CLI and config files.",
"version": "0.4.0",
"project_urls": {
"GitHub": "https://github.com/RalfG/cascade-config",
"ReadTheDocs": "https://cascade-config.readthedocs.io/en/stable/"
},
"split_keywords": [
"configuration",
"command line interface",
"configuration files",
"json"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b76c533f2304e9bbdfc16befa85c6c0ddc6592a2512424350648ae2dd5240f8f",
"md5": "07295049a62a44727cef02938bd1dfd8",
"sha256": "0b2d5825c5b22b10de7e0bf36a056b004a948c6d6d5a3130cb7b692f55d4a67b"
},
"downloads": -1,
"filename": "cascade_config-0.4.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "07295049a62a44727cef02938bd1dfd8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 8327,
"upload_time": "2023-07-03T15:01:39",
"upload_time_iso_8601": "2023-07-03T15:01:39.173145Z",
"url": "https://files.pythonhosted.org/packages/b7/6c/533f2304e9bbdfc16befa85c6c0ddc6592a2512424350648ae2dd5240f8f/cascade_config-0.4.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "952c321eaf04f9035c056ed40988357428efffe0e7055dd01566684e6aa856a9",
"md5": "e9e22d2f16e7b546b1114bfbbddf405d",
"sha256": "cb3cffd3e9899b6aa46f29e5462b413cfdd94e74e36748e977d1949c46478715"
},
"downloads": -1,
"filename": "cascade_config-0.4.0.tar.gz",
"has_sig": false,
"md5_digest": "e9e22d2f16e7b546b1114bfbbddf405d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 14728,
"upload_time": "2023-07-03T15:01:41",
"upload_time_iso_8601": "2023-07-03T15:01:41.009111Z",
"url": "https://files.pythonhosted.org/packages/95/2c/321eaf04f9035c056ed40988357428efffe0e7055dd01566684e6aa856a9/cascade_config-0.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-03 15:01:41",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "RalfG",
"github_project": "cascade-config",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "cascade-config"
}