python-decouple
Strict separation of settings from code.
Decision gist · record as of 2026-08-14
Yes. This is a mature, stable library with no dependencies, low install friction, and no known vulnerabilities. It solves a real problem (type-safe configuration from environment) that most Python applications face. The dormant maintenance status is not a concern for a small, focused tool that does one thing well and has been Production/Stable since 2014. Install it if you need to manage settings separately from code.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low install friction with no runtime dependencies.
- Maintenance is dormant (last release 2023-03-01, 1262 days ago), but the package is marked Production/Stable and has accumulated 3039 repository stars, suggesting it is mature and widely relied upon despite infrequent updates.
License · maintenance · safety
MIT (permissive) — MIT license is permissive, allowing commercial and private use with minimal restrictions—you may use, modify, and distribute the package freely provided you include the license notice.
last release 2023-03-01 (1262 days) · last repo commit 2024-11-28 · 3,039 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 8,769,852 downloads/mo, #1,596 on PyPI
Alternatives
Verify before relying
pip install python-decouple
from decouple import config
DEBUG = config('DEBUG', default=False, cast=bool)
SECRET_KEY = config('SECRET_KEY')
EMAIL_PORT = config('EMAIL_PORT', default=25, cast=int)- Whether the package actively maintains compatibility with modern Python versions beyond what classifiers indicate.
- Performance characteristics when reading large numbers of configuration parameters.
What it is and what it does
Python Decouple is a configuration management library that reads settings from environment variables, .env files, or ini files and makes them available to your Python code with optional type casting and default values. It solves the problem that environment variables are always strings—if you read DEBUG=False from an environment variable, a simple truthiness check will treat it as True because the string "False" is non-empty. Decouple lets you cast values to the correct type (bool, int, list, etc.) and define sensible defaults, so your code can safely assume the right data types.
Originally designed for Django, it has become a framework-agnostic tool used across web frameworks and general Python applications. It respects Unix convention by checking environment variables first, then falling back to config files, then to defaults you provide. The library is lazy—it only opens and parses config files when first needed—and supports UTF-8 encoding by default with the option to specify another.
Use it for
- Store database credentials, API keys, and service URLs in .env files without committing them to version control.
- Toggle DEBUG mode and feature flags between development, staging, and production without redeploying code.
- Configure email, cache, and logging backends with environment-specific values in Django or Flask settings.
- Cast port numbers, timeouts, and batch sizes from environment strings to integers in application initialization.
- Define per-deployment hostnames and SSL settings that change between instances without code changes.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
This is a mature, stable library with no dependencies, low install friction, and no known vulnerabilities. It solves a real problem (type-safe configuration from environment) that most Python applications face. The dormant maintenance status is not a concern for a small, focused tool that does one thing well and has been Production/Stable since 2014. Install it if you need to manage settings separately from code.
Install
python-decouple on PyPI
Before you install
Low install friction with no runtime dependencies. Maintenance is dormant (last release 2023-03-01, 1262 days ago), but the package is marked Production/Stable and has accumulated 3039 repository stars, suggesting it is mature and widely relied upon despite infrequent updates.
License in practice
MIT license is permissive, allowing commercial and private use with minimal restrictions—you may use, modify, and distribute the package freely provided you include the license notice.
Quickstart
pip install python-decouple
from decouple import config
DEBUG = config('DEBUG', default=False, cast=bool)
SECRET_KEY = config('SECRET_KEY')
EMAIL_PORT = config('EMAIL_PORT', default=25, cast=int)
Verify before relying
- Whether the package actively maintains compatibility with modern Python versions beyond what classifiers indicate.
- Performance characteristics when reading large numbers of configuration parameters.
Package facts
| License | MIT permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Dormant 1,262 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 8,769,852 / month, #1,596 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableFramework :: DjangoFramework :: FlaskIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Topic :: Software Development :: Libraries |
Evidence: python_decouple-3.8-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 › “settings management from env files”
- python-decoupleReads configuration parameters from environment variables, .env…
- pydantic-settingsLoads and validates application settings from environment variables,…
- everettEverett is a configuration library that reads settings from…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
See also django-environ · typed-config · pytest-env · bestconfig · everett · django-split-settings · ssm-parameter-store · config-parser · ovos-config · environs