environs
simplified environment variable parsing
Decision gist · record as of 2026-08-14
Yes. environs is actively maintained, has no known vulnerabilities, low install friction, and solves a common problem—parsing and validating environment variables—with a clean API. The permissive MIT license and broad Python version support (3.10+) make it a safe, practical choice for any project that needs configuration management.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Low install friction with three lightweight runtime dependencies (python-dotenv, marshmallow, typing-extensions).
- The package is actively maintained with recent releases and a stable repository.
License · maintenance · safety
MIT (permissive) — MIT license permits unrestricted use, modification, and distribution in both open-source and proprietary projects with minimal obligations.
last release 2026-08-01 (13 days) · last repo commit 2026-08-08 · 1,373 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 5,249,457 downloads/mo, #2,128 on PyPI
Alternatives
Verify before relying
pip install environs
from environs import env
env.read_env() # load .env file if present
max_connections = env.int("MAX_CONNECTIONS", default=10)
enable_debug = env.bool("DEBUG", default=False)
repos = env.list("REPOS", default=[])- Performance characteristics when parsing large numbers of environment variables.
- Compatibility with async frameworks or concurrent environment variable access patterns.
What it is and what it does
environs is a Python library that reads environment variables and casts them to typed Python objects—integers, booleans, dates, lists, dictionaries, and other types—with optional validation. It follows the Twelve-Factor App methodology by keeping configuration separate from code. The library can load variables from .env files without modifying os.environ, and supports prefixing, variable expansion, and custom validation rules.
You use it by instantiating an Env object, optionally calling read_env() to load a .env file, then calling type-specific methods like env.int(), env.bool(), or env.list() to retrieve and cast individual variables. It integrates with marshmallow for validation, allowing you to apply built-in validators or define custom ones. The library is framework-agnostic but has documented patterns for Flask and Django.
Use it for
- Load database credentials and connection settings from environment variables in production deployments.
- Parse feature flags and debug settings from .env files during local development without hardcoding them.
- Validate and type-cast configuration like port numbers, timeouts, and log levels from environment variables.
- Read Docker secrets or Kubernetes ConfigMaps as environment variables with automatic type conversion.
- Build configuration management that respects the Twelve-Factor App pattern across development, staging, and production.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
environs is actively maintained, has no known vulnerabilities, low install friction, and solves a common problem—parsing and validating environment variables—with a clean API. The permissive MIT license and broad Python version support (3.10+) make it a safe, practical choice for any project that needs configuration management.
Install
environs on PyPI
Before you install
Low install friction with three lightweight runtime dependencies (python-dotenv, marshmallow, typing-extensions). The package is actively maintained with recent releases and a stable repository.
Requires Python 3.10 or later.
License in practice
MIT license permits unrestricted use, modification, and distribution in both open-source and proprietary projects with minimal obligations.
Quickstart
pip install environs
from environs import env
env.read_env() # load .env file if present
max_connections = env.int("MAX_CONNECTIONS", default=10)
enable_debug = env.bool("DEBUG", default=False)
repos = env.list("REPOS", default=[])
Verify before relying
- Performance characteristics when parsing large numbers of environment variables.
- Compatibility with async frameworks or concurrent environment variable access patterns.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagespython-dotenvmarshmallowtyping-extensions |
| Maintenance | Actively maintained 13 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 5,249,457 / month, #2,128 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Intended Audience :: DevelopersNatural Language :: EnglishProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14 |
Evidence: environs-15.1.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “type-cast environment variables”
- environsenvirons parses environment variables into typed Python objects with…
- bestconfigLoads configuration from multiple file formats (.yaml, .json, .ini,…
- envtplRenders Jinja2 templates on the command line, substituting shell…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also cabina · envparse · envsubst · envier · dump-env · python-json-config · expandvars · fastapi-cors · marshmallow-enum · python-dotenv