Skip to main content

Python port of brek, a structured config loader with layered files and loaders.

Project description

brek

build status SemVer Conventional Commits AutoRel

This project is the Python port of the original brek project.

brek keeps the same core principles:

  • declarative JSON configuration
  • layered config files
  • environment variable interpolation
  • loader-based dynamic values
  • a bundled AWS Secrets Manager loader

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

Or use it from Python:

from brek import DefaultLoaders, GetConfig, SetLoaders

SetLoaders(DefaultLoaders())
conf = GetConfig()
print(conf["port"])

Features

  • JSON config files with default, environment, deployment, and user overlays.
  • CLI and environment overrides through BREK or OVERRIDE.
  • Environment variable expansion via ${VAR} syntax.
  • Loader support for runtime values.
  • Bundled awsSecret loader for AWS Secrets Manager.
  • 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

brek-0.0.2.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

brek-0.0.2-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file brek-0.0.2.tar.gz.

File metadata

  • Download URL: brek-0.0.2.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for brek-0.0.2.tar.gz
Algorithm Hash digest
SHA256 9e647a3e5e68483648bb830b188e1dab49e1ffd9c81382b090e3db49e1d2c264
MD5 79593526d786b3350fcd498adb39e744
BLAKE2b-256 56d096738c709cdd06e6ac0c644f9b22e29e7d5f5580d58a636b9fbdb3e82b80

See more details on using hashes here.

Provenance

The following attestation bundles were made for brek-0.0.2.tar.gz:

Publisher: pypi-publish.yml on Tatch-AI/brek-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file brek-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: brek-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for brek-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 295b367bd981c0fbb33718e3b6b27fb4f1ad2c50340d789c52ed1b11002edb2c
MD5 9cf4edde0381539b8a0fb87ef7ac8141
BLAKE2b-256 f7492474aba6e0c2ecfd2d6fa43a4aa8a7f20fa79f7ba7003961dde9ccbea26d

See more details on using hashes here.

Provenance

The following attestation bundles were made for brek-0.0.2-py3-none-any.whl:

Publisher: pypi-publish.yml on Tatch-AI/brek-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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