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(
    files=["config.yml", "config.local.toml"],
    dotenv=".env",
)

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.2.1.tar.gz (8.0 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.2.1-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for configblanket-1.2.1.tar.gz
Algorithm Hash digest
SHA256 5aa9e403bbe66760a43b7234a861362717f9d5014e17d3c1fbdaa658c92682ae
MD5 a421fb02dbfe6c042450b6ca7ded81bb
BLAKE2b-256 f7553c49f1a4b35e2d74531ad26cbd6d703d9ac28f086cc50a617b8ab2b54174

See more details on using hashes here.

Provenance

The following attestation bundles were made for configblanket-1.2.1.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.2.1-py3-none-any.whl.

File metadata

  • Download URL: configblanket-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 3.3 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.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 15aed47b5ede64f67e176bfcc2099ffc3ce46b262383097bc7471a8fb0a2360e
MD5 a77dc26b634376a952672257c73028e7
BLAKE2b-256 05ecc4990ee468f6118ed0b3f3bc6d74d5eca3acb144ebe75d961e1ea4215076

See more details on using hashes here.

Provenance

The following attestation bundles were made for configblanket-1.2.1-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