Skip to main content

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


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.1.tar.gz (7.4 kB view hashes)

Uploaded Source

Built Distribution

settingscascade-0.3.1-py3-none-any.whl (8.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page