Skip to main content

Flexible configuration orchestration for Python applications

Project description

ConfigBlanket

Python 3.10+ License: MIT

Flexible configuration orchestration for Python applications — load settings from code defaults, config files, environment variables, .env files, CI/CD variables, CLI arguments, and optional interactive prompts.

Features

  • Multi-source loading with configurable precedence
  • Source tracking — know where every value came from
  • Typed config classes with validation
  • Secret masking in repr, explain, and exports
  • Nested configuration with __ env delimiter
  • Pluggable file parsers (JSON, YAML, TOML, INI, dotenv)
  • CI/CD aware — auto-disables prompting in CI and non-TTY environments
  • CLI help — auto-generated --help from your config schema

Default precedence

CLI > CI/CD env > OS env > .env > config files > code defaults > interactive prompt

Quick start

from configblanket import Config, field

class AppConfig(Config):
    database_url: str = field(required=True, env="APP_DATABASE_URL", secret=True)
    api_key: str = field(required=True, env="APP_API_KEY", secret=True)
    debug: bool = field(default=False, env="APP_DEBUG", cli="--debug")
    port: int = field(default=8000, env="APP_PORT", cli="--port")

config = AppConfig.load(
    files=["config.yml", "config.local.toml"],
    dotenv=".env",
    cli=True,
    interactive=True,
)

print(config.port)
print(config.source_of("port"))
print(config.explain())

Installation

pip install configblanket
pip install configblanket[yaml]      # YAML support
pip install configblanket[toml]      # TOML on Python < 3.11
pip install configblanket[all]       # all optional extras

Documentation

Development

python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[yaml,dev]"
pytest
python -m build
twine check dist/*

Releases are published to PyPI automatically when a GitHub Release is published. See PUBLISHING.md for setup.

License

Copyright (c) 2026 Yoseph

Released under the MIT License.

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

configblanket-1.1.0.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

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

configblanket-1.1.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file configblanket-1.1.0.tar.gz.

File metadata

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

File hashes

Hashes for configblanket-1.1.0.tar.gz
Algorithm Hash digest
SHA256 cd8077c731b744aa19eccc0c48bb9a96d4da98801b4b9d33045ed5ae9134d3e1
MD5 5a5756e5e48d97509efc43c272095796
BLAKE2b-256 9541a7a3bbc40846f526530926ab72a9abfd0a7b39b66cd8e24b8e991914af11

See more details on using hashes here.

Provenance

The following attestation bundles were made for configblanket-1.1.0.tar.gz:

Publisher: publish.yml on yosephberhanu/configblanket

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

File details

Details for the file configblanket-1.1.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for configblanket-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d55596fc4f8623e36827993e12f8fb7c5db030699f21d88e1e1a6e4d6f34d6d7
MD5 26519929c36dcb3e68c31cef142944ef
BLAKE2b-256 fad0f0f94b61cd2b8e8e6682c35438731729fdfbd10afb70b481cc5b68eef4b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for configblanket-1.1.0-py3-none-any.whl:

Publisher: publish.yml on yosephberhanu/configblanket

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