skillfed

environ-config

Boilerplate-free configuration with env variables.

environ-config v26.1.0 198.2K downloads/30d#9,736 on PyPI
Permissive license Apache-2.0 Active released

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-config

uv

uv add environ-config

poetry

poetry add environ-config

Installing 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

Development Status :: 5 - Production/StableLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.15Typing :: Typed

Tags

environment variable configurationenv config loadertwelve factor app configdeclarative config from envnested environment configurationconfig with attrssecrets from environment
configuration-managementenvironment-variablestwelve-factor

More Software Development packages