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.
Install from PyPI:
python -m pip install brekOr 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-configbrek 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"))- 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.
make testReleases 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.
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.