environ-config
Boilerplate-free configuration with env variables.
What it is and what it does
environ-config is a Python library that maps environment variables into typed, validated configuration objects using declarative class definitions. It builds on attrs to provide automatic data validation and conversion, eliminating boilerplate code typically needed for environment-based config. The package follows the Twelve-Factor App methodology and supports nested configuration from flat environment variable names, default and mandatory values, and pluggable secrets extraction from HashiCorp Vault, AWS Secrets Manager, or INI files.
You define your config as a class with environ.var() and environ.bool_var() fields, optionally nested with environ.group(), then call environ.to_config() to populate it from os.environ or a custom dict. The library handles type conversion (e.g., string to int), boolean parsing (recognizing 'true', 'yes', '1'), and validation through attrs converters and validators. It also generates helpful debug logging showing which variables are present and what the library is looking for.
Use it for:
- Manage multi-environment application settings (dev, staging, prod) by reading from environment variables without hardcoding or config files.
- Extract database credentials and API keys from Vault or AWS Secrets Manager into a typed config object with validation.
- Build nested configuration hierarchies (e.g., separate DB, cache, and logging sections) from flat environment variable names.
- Enforce required config fields and provide sensible defaults without writing validation logic.
- Generate dynamic help documentation for environment variables your application expects.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Loads application configuration from environment variables using declarative Python classes, with support for nested config, type conversion, validation, and pluggable secrets extraction.
Yes. Low install friction, active maintenance, permissive license, no known vulnerabilities, and production-stable status make it a safe choice. Install if you need declarative, type-safe environment-based configuration with minimal boilerplate—especially valuable in containerized or cloud-native deployments following Twelve-Factor principles. Requires Python 3.10+.
Install
environ-config on PyPI
pip
pip install environ-configuv
uv add environ-configpoetry
poetry add environ-configInstalling environ-config
Before you install
Low install friction—a pure Python wheel with only attrs as a runtime dependency. Actively maintained as of 23 days ago with production-stable status.
License in practice
Apache 2.0 permissive license allows commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
pip install environ-config
import environ
@environ.config(prefix="APP")
class AppConfig:
env = environ.var()
debug = environ.bool_var()
cfg = environ.to_config(AppConfig, environ={"APP_ENV": "prod", "APP_DEBUG": "no"})
Requires Python 3.10 or later; support for Python 3.8 and 3.9 was removed in version 26.1.0.
Verify before relying
- Whether boto3 is automatically installed for AWS Secrets Manager support or must be added separately.
- Performance characteristics when dealing with large numbers of environment variables or deeply nested config structures.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — attrs |
| Maintenance | actively maintained — 23 days since the last release |
| First released | |
| Downloads | 198,210/month — #9,736 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: environ_config-26.1.0-py3-none-any.whl
Keywords: app, cfg, config, env
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
dynaconfDynaconf manages application configuration…
permissive · top 5,000 on PyPI
typed-settingsLoads and merges settings from multiple sources…
permissive · top 5,000 on PyPI
envierEnvier extracts application configuration from…
permissive · top 1,000 on PyPI
typed-configReads typed configuration from multiple sources…
permissive · top 15,000 on PyPI
hvachvac is a Python client library for HashiCorp…
permissive · top 1,000 on PyPI
pydantic-settingsLoads and validates application settings from…
permissive · top 100 on PyPI
pytest-dotenvA pytest plugin that automatically loads…
permissive · top 5,000 on PyPI
attrsattrs is a Python library that automatically…
permissive · top 100 on PyPI
environManages stack-based global variables that can…
copyleft · top 15,000 on PyPI
sample-helper-aws-appconfigFetches and caches configuration from AWS…
permissive · top 15,000 on PyPI