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

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-0.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-0.1.0-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: configblanket-0.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-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4e681e5e7d9b7be16caafcbcf7fd9e28f23f59345c1ccf9f8c8a379ab5392ce0
MD5 f027ca5d0f2b2f914a763559e232d90d
BLAKE2b-256 e79f8816d2bdaa0aa9d01c0ae9cc43d292e28716787ac0f1c88b81ddfc490966

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: configblanket-0.1.0-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-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0095387092a01ddb5fc32af6f05869f78b8f3a9f7a116f3c8f047fdd74a97652
MD5 fdc86136cc0af8cb29b7a414e6bde858
BLAKE2b-256 55b0773b5ec2b269a257c1cfcae8063752d135dac8a44120dc8a6ff3dcde42eb

See more details on using hashes here.

Provenance

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