Configurave
Configurave is a one-stop configuration engine that permits writing your configuration as a simple decorated class, and then loading the values from a series of configuration files or providers.
Values loaded from later sources override values provided by earlier sources. Types of the loaded configuration values are checked.
While not currently functional, there are plans and code to write out a default configuration generated directly from the configurave decorated class with .defaults_toml().
This project has undergone MINIMAL testing and work. It is likely very buggy at this time. Stay tuned for more!
Example usage:
from typing import List
from configurave import make_config, ConfigEntry as ce
@make_config()
class MyConfig:
site_root: str = ce(comment="The root url the site should be mounted on")
template_root: str = ce(comment="Directory under which templates should be found")
allowed_hosts: List[str] = ce(
comment="A comma separated list of hosts that we are permitted to server content to",
validator=lambda config, value: len(value) > 0,
)
token: str = ce(comment="The discord auth token", secret=True)
config = MyConfig(sources=["tests/test-config/readme.toml"])
print(config.site_root, config.template_root, config.allowed_hosts[0], sep="\n")
This will load from a file that looks like:
template_root = "./templates"
allowed_hosts = "mydomain.com,example.example,localhost:8080"
[site]
root = "/"
or
TEMPLATE_ROOT="./templates"
ALLOWED_HOSTS="mydomain.com,example.example,localhost:8080"
SITE_ROOT="/"
and print:
/
./templates
["mydomain.com", "example.example", "localhost:8080"]
Metadata
Release files for configurave 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| configurave-0.1.2.tar.gz | 6.3 kB | Without provenance | Details for configurave-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| configurave-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for configurave-0.1.2-py3-none-any.whl |
Total release size: 11.8 kB
Release files / configurave-0.1.2.tar.gz
| Download URL | configurave-0.1.2.tar.gz |
|---|---|
| Size | 6.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fc1e1b4d1d6eb95e1cba62188845c36c9206d42d0a81e4066ffb78ffb851d741
|
|
BLAKE2b-256 checksum How to use checksums |
b62fa64620c972789c96b16dbaa5289fec749fbb54e3c1ee69983941961bbc23
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.5 CPython/3.9.5 Darwin/20.6.0
|
Release files / configurave-0.1.2-py3-none-any.whl
| Download URL | configurave-0.1.2-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0718278b6388833af817351dedff38499a2534727707057f0e6726399141de60
|
|
BLAKE2b-256 checksum How to use checksums |
024c93f7e1afa43e6f1b1217980ae811fa62f70754ea923176a3883e9188b9d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.5 CPython/3.9.5 Darwin/20.6.0
|
Security for configurave 0.1.2
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.