Cascade settings from multiple levels of specificity
Project description
Intro
Settings cascade is designed for situations where you need to merge configuration settings from different hierarchical sources. The model is the way that CSS cascades onto elements. You can define config the same way that css rules get specified-
task.default:
command: "echo hello"
on_complete: "echo world"
project_name: "my project"
Then your app can use the config
class Task(SettingsSchema):
_name_ = task
command: str
on_complete: str
config = SettingsManager(yaml.load("config.yml"), [Task])
task_config = config.task(class="default")
run_task(
command=task_config.command,
on_complete=task_config.on_complete,
name=config.project_name,
)
Read the full documentation at https://settingscascade.readthedocs.io/en/latest/
Installation
You can install settingscascade from pypi-
pip install settingscascade
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
settingscascade-0.3.3.tar.gz
(7.9 kB
view hashes)
Built Distribution
Close
Hashes for settingscascade-0.3.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4881390bbd74396db4661f5dfcdcebe74b7610f83222a4ae8382c4e464fda1fb |
|
MD5 | 2b175007d42f0b28baaabc332ed313bb |
|
BLAKE2b-256 | 4d7934de898a53030dcb7e2171aff14800d095574369a81650b4bd391cefa34c |