$npx skillfedfor your agent

python-dotenv

Read key-value pairs from a .env file and set them as environment variables

Worth itPyPI UtilitiesReleased Mar 2026740.1M downloads / moBSD-3-ClausePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — python_dotenv-1.2.2-py3-none-any.whl
v1.2.2 · released 2026-03-01 · Python >=3.10

Yes. python-dotenv is a production-stable, zero-dependency utility with active maintenance, no known vulnerabilities, and permissive licensing. It solves a common development workflow problem cleanly and is widely adopted (top 100 PyPI by downloads). Install it if your application reads configuration from environment variables.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.10 or later.
  • Low friction installation with no runtime dependencies.
  • Active maintenance with recent release (166 days ago) and strong repository signal (8845 stars).

License · maintenance · safety

BSD-3-Clause (permissive) — BSD-3-Clause permissive license allows use in commercial and private projects with minimal restrictions; retain license notice in distributions.

last release 2026-03-01 (166 days) · last repo commit 2026-07-26 · 8,845 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 740,099,887 downloads/mo, #41 on PyPI

Verify before relying

pip install python-dotenv

from dotenv import load_dotenv

load_dotenv()  # reads .env file and sets variables in os.environ
  • Whether variable expansion supports nested references or only single-level interpolation.
  • Performance characteristics when loading very large .env files.
  • Behavior when .env file contains syntax errors or malformed entries.
Same gist for agents: .md · .json

What it is and what it does

python-dotenv is a lightweight library that reads configuration from a .env file and populates environment variables, designed for applications following 12-factor principles. It bridges the gap between development (where you want configuration in a file) and production (where configuration comes from the actual environment), allowing the same code to work in both contexts without modification.

The package provides two main patterns: `load_dotenv()` modifies `os.environ` directly, while `dotenv_values()` returns a dictionary without altering the environment. It supports variable expansion using POSIX syntax (e.g., `${DOMAIN}`), multiline values, comments, and quoted strings. An optional CLI tool allows manipulation of .env files without manual editing. The library has no runtime dependencies and installs cleanly across modern Python versions.

Use it for

  • Load database credentials and API keys from .env during development without committing secrets to version control.
  • Configure different settings for development, staging, and production by switching .env files or environment variables.
  • Parse configuration from a stream (network, StringIO) instead of the filesystem for advanced deployment scenarios.
  • Manage layered configuration by merging multiple .env files (shared, secret, environment-specific) into a single config dict.
  • Use the CLI tool to set or list environment variables in .env without opening an editor.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

python-dotenv is a production-stable, zero-dependency utility with active maintenance, no known vulnerabilities, and permissive licensing. It solves a common development workflow problem cleanly and is widely adopted (top 100 PyPI by downloads). Install it if your application reads configuration from environment variables.

Install

python-dotenv on PyPI

Before you install

Low friction installation with no runtime dependencies. Active maintenance with recent release (166 days ago) and strong repository signal (8845 stars). Supports current Python versions from 3.10 through 3.14.

Requires Python 3.10 or later.

License in practice

BSD-3-Clause permissive license allows use in commercial and private projects with minimal restrictions; retain license notice in distributions.

Quickstart

pip install python-dotenv

from dotenv import load_dotenv

load_dotenv()  # reads .env file and sets variables in os.environ

Verify before relying

  • Whether variable expansion supports nested references or only single-level interpolation.
  • Performance characteristics when loading very large .env files.
  • Behavior when .env file contains syntax errors or malformed entries.

Package facts

LicenseBSD-3-Clause permissive
Python supportSupports the current Python release >=3.10
Install frictionLow. Pure-Python wheel
Runtime dependenciesNone
MaintenanceActively maintained 166 days since the last release
Last repo commit
First released
Downloads740,099,887 / month, #41 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentIntended Audience :: DevelopersIntended Audience :: System AdministratorsOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: PyPyTopic :: System :: Systems AdministrationTopic :: Utilities

Evidence: python_dotenv-1.2.2-py3-none-any.whl

Tags

Capabilities
load environment variables from .env filedotenv configuration managementpython environment variable loader.env file parser12-factor app configenvironment variable expansiondevelopment settings from file
Topics
configuration-managementenvironment-variables12-factor
PyPI keywords
environment variablesdeploymentssettingsenvdotenvconfigurationspython

Let your AI agent find packages like this

Example. Real query, live index.

An agent finds packages by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language. Give your agent the search over MCP.

More Utilities packages

idna Worth it
PyPI · Python Modules · released Jun 2026

Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.

Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.

BSD-3-Clausepure Python · 3.9+
1.8Bdownloads / mo
charset-normalizer Worth it
PyPI · Utilities · released Aug 2026

Detects and normalizes text encoding from unknown or ambiguous sources, supporting all IANA character sets that Python's core library provides codecs for, with the ability to register custom codecs.

permissive licensepure Python · 3.7+
1.7Bdownloads / mo
setuptools Worth it
PyPI · Python Modules · released Aug 2026

Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.

MITpure Python · 3.10+
1.6Bdownloads / mo
pluggy Worth it
PyPI · Libraries · released May 2025

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.

MITpure Python · 3.9+aging
1.3Bdownloads / mo
Pygments Worth it
PyPI · Utilities · released Mar 2026

Pygments is a syntax highlighter that colorizes source code and text in over 500 languages and formats, outputting to HTML, LaTeX, RTF, SVG, images, or ANSI terminal sequences.

Install it if you need to display or transform source code.

BSD-2-Clausepure Python · 3.9+
1.3Bdownloads / mo
six With conditions
PyPI · Libraries · released Dec 2024

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.

MITpure Python
1.2Bdownloads / mo

See also django-dotenv · dotenv · dynaconf · load-dotenv · pytest-dotenv · poetry-dotenv-plugin · everett · django-environ · pytest-env · envier