# theskumar/python-dotenv

Reads key-value pairs from a .env file and can set them as environment variables. It helps in developing applications following the 12-factor principles.

Repository: https://github.com/theskumar/python-dotenv
Canonical: https://ross.abutalabs.com/products/python-dotenv
Homepage: https://saurabh-kumar.com/python-dotenv/
Language: Python
License: BSD-3-Clause
License Family: permissive
Topics: python, devops-tools, dotenv, 12-factor-app, configuration, env, environment-variables
Last push: 2026-08-23T13:32:35+00:00

## Health v2 (maintenance only)
Score: 90/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 99, release rhythm 74, longevity 100
- inputs: {"age_days": 4379, "days_push": 10, "days_rel": 17, "gap_med": 124, "n_releases_24m": 6}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 8854, forks 568 (observed 2026-08-28T04:10:26.040036+00:00)

## What it is
python-dotenv is a Python library that reads key-value pairs from a .env file and sets them as environment variables, following 12-factor app principles. It also provides a CLI (dotenv run/set/unset) and utilities to parse .env files without modifying the environment.

## Use cases
- load environment variables from a .env file in python
- manage app configuration for 12-factor apps
- parse .env files into a dict without touching os.environ
- run commands with variables loaded from a .env file
- set and unset keys in a .env file programmatically
- load .env files in IPython

## When to choose
- your Python app reads configuration from environment variables and you want a .env file for local development
- you need variable expansion and multiline values in .env files
- you want a small, well-maintained, BSD-licensed dependency

## When to avoid
- you need full configuration management with nested structures or multiple formats (consider pydantic-settings or dynaconf)
- your runtime platform natively loads .env files (e.g. Docker Compose, many frameworks)
- you need to manage secrets securely rather than in plaintext files

## Facets
- artifact type: library
- maturity: stable
- function: configuration-management, cli, parser
- domain: developer-tools
- platform: python, cli, cross-platform
- tags: dotenv, environment-variables, 12-factor-app, settings, secrets, devops, automation

## Member repositories
- theskumar/python-dotenv (main) score 90

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:10:26.040036+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:24:47.388377+00:00, confidence not recorded.
  - readme: https://github.com/theskumar/python-dotenv (fetched 2026-08-28T04:10:26.040036+00:00, sha d2eaf7233665)
  - homepage: https://saurabh-kumar.com/python-dotenv/ (fetched 2026-08-29T08:25:07.435603+00:00, sha 484a90e6d99f)
  - registry_pypi: https://pypi.org/pypi/python-dotenv/json (fetched 2026-08-29T08:25:07.442299+00:00, sha 05ef4c2db5f7)
  - site_page: https://saurabh-kumar.com/python-dotenv/changelog (fetched 2026-08-29T08:25:07.439519+00:00, sha b597ee9fe296)
- Data as of 2026-08-30T08:39:29.467469+00:00.
