Skip to main content

Intro

pypi bld cvg black

One of the most common ways to let users customize the way an app works is to use config files. This means that many projects wind up including an implementation to read in the config values, specify defaults, control which values get looked up when, and enforce some sort of schema.

settingscascade is designed to handle this scenario. While it can be used in simple situations, it really shines when you need to pull in values from a variety of sources, have a rich set of defaults, and give users flexibility in configuring overrides at various levels. The model it uses is CSS, mimicking the way that css uses selectors to cascade settings from various levels of specificity. Your users specify rule blocks the same as they would in CSS-

# Each rule block has a selector, using CSS semantics
# this block is for a task element with the class "default"
task.default:
    command: "echo hello"
    on_complete: "echo world"

# You can specify top level settings as well for a final
# level of fallback
project_name: "my project"

Then your app can use the config

# Task represents an element (like a div or a in HTML).
# you can specify what values are valid for this element type
class Task(SettingsSchema):
        _name_ = task
        command: str
        on_complete: str

config = SettingsManager(yaml.load("config.yml"), [Task])

# In your code, you can pull an element from the settingsmanager
# object and find the rules that apply. This is like an element
# <task class="default"></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

Metadata

Release files for settingscascade 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for settingscascade 0.5.0
File Size Uploaded Provenance Actions
settingscascade-0.5.0.tar.gz 9.8 kB Without provenance Details for settingscascade-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for settingscascade 0.5.0
File Interpreter ABI Platform Actions
settingscascade-0.5.0-py3-none-any.whl Python 3 none any Details for settingscascade-0.5.0-py3-none-any.whl

Total release size: 19.9 kB

Release files / settingscascade-0.5.0.tar.gz

Download URL settingscascade-0.5.0.tar.gz
Size 9.8 kB
Tags Source
SHA-256 checksum
How to use checksums
1931eb3ff7f8cfee409f783e4d79a59bcf6aa67cd0aa62604e1c6eed82f42e80
BLAKE2b-256 checksum
How to use checksums
80cdfb28c13aca93ab0d4acf3df2b00ea5688d649ab6c9734d59a2355e1af1db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.9 CPython/3.8.3 Linux/4.19.78-coreos

Release files / settingscascade-0.5.0-py3-none-any.whl

Download URL settingscascade-0.5.0-py3-none-any.whl
Size 10.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
72cd982d8cacbac2d3192051b4a3a07958000ae4a38fd9e0e3898aec2877038a
BLAKE2b-256 checksum
How to use checksums
d1473868f13ddff69e97dfd007a76119ce988d719ddb98a55c439a36eb4402fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.9 CPython/3.8.3 Linux/4.19.78-coreos

Security for settingscascade 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page