Python port of brek, a structured config loader with layered files and loaders.
Project description
brek
This project is the Python port of the original brek project.
brek keeps the same core principles:
- declarative JSON configuration
- layered config files
- strict environment variable interpolation via
${VAR} - loader-based dynamic values
- a bundled AWS Secrets Manager loader
- strict runtime resolution for required config paths
brek stands for Blocking Resolution of Environment Keys.
Quick Start
Install from PyPI:
python -m pip install brek
Or install from a checkout:
python -m pip install -e .
Create a config/default.json file:
{
"port": 3000,
"postgres": {
"host": "localhost"
},
"secret": {
"[awsSecret]": {
"key": "demo",
"region": "us-west-2"
}
}
}
Generate the resolved cache:
brek load-config
brek load-config always re-resolves config and rewrites the generated cache file.
Within a running Python process, GetConfig() is cached after the first load.
Or use it from Python:
from brek import DefaultLoaders, GetConfig, SetLoaders, require_path
SetLoaders(DefaultLoaders())
conf = GetConfig()
print(require_path(conf, "port"))
Features
- JSON config files with default, environment, deployment, and user overlays.
- CLI and environment overrides through
BREKorOVERRIDE. - Environment variable expansion via
${VAR}syntax. - Loader support for runtime values.
- Bundled
awsSecretloader for AWS Secrets Manager. - Strict access helpers for required and optional paths.
- Standard-library core with no mandatory runtime dependencies.
Docs
Development
make test
Release
Releases are created by AutoRel from conventional commits on main and next.
When GitHub creates a release, the pypi-publish.yml workflow builds an sdist and wheel
and publishes them to PyPI using Trusted Publishing.
To enable publishing, configure Tatch-AI/brek-python as a trusted publisher in the
PyPI project settings for the pypi environment and .github/workflows/pypi-publish.yml.
Support
The original implementation lives at mhweiner/brek.
Releases are automated with autorel from conventional commits on main and next.
Release commits should follow the same conventional-commit format used by the original project.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file brek-0.1.1.tar.gz.
File metadata
- Download URL: brek-0.1.1.tar.gz
- Upload date:
- Size: 13.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2f13affd2f655fa2198c346fa8a2b85c535932b2e458a5bbc3f8267335ac8fb
|
|
| MD5 |
9d87c801fb41737cc8899409d1835c07
|
|
| BLAKE2b-256 |
3f64ee66a50c7b97015140af83d358c388aa78d934358cde8a2bf1a63425ece7
|
Provenance
The following attestation bundles were made for brek-0.1.1.tar.gz:
Publisher:
pypi-publish.yml on Tatch-AI/brek-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
brek-0.1.1.tar.gz -
Subject digest:
a2f13affd2f655fa2198c346fa8a2b85c535932b2e458a5bbc3f8267335ac8fb - Sigstore transparency entry: 1592736660
- Sigstore integration time:
-
Permalink:
Tatch-AI/brek-python@af303744a857e5a34ffe29701c5016d38950409d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Tatch-AI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@af303744a857e5a34ffe29701c5016d38950409d -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file brek-0.1.1-py3-none-any.whl.
File metadata
- Download URL: brek-0.1.1-py3-none-any.whl
- Upload date:
- Size: 12.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a8317a8c081d7fbbd7b8ad26e6e1b272a742a269770c2cba780f4627755933f
|
|
| MD5 |
1413e181cf2b75aef4e1a582e4ccf1e9
|
|
| BLAKE2b-256 |
e70d261c85a6b1ae6582a7d1f3c9b801d7c9e30d60dd2c39a3528afd7164599c
|
Provenance
The following attestation bundles were made for brek-0.1.1-py3-none-any.whl:
Publisher:
pypi-publish.yml on Tatch-AI/brek-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
brek-0.1.1-py3-none-any.whl -
Subject digest:
5a8317a8c081d7fbbd7b8ad26e6e1b272a742a269770c2cba780f4627755933f - Sigstore transparency entry: 1592736748
- Sigstore integration time:
-
Permalink:
Tatch-AI/brek-python@af303744a857e5a34ffe29701c5016d38950409d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Tatch-AI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@af303744a857e5a34ffe29701c5016d38950409d -
Trigger Event:
workflow_dispatch
-
Statement type: