skillfed

poetry-dotenv-plugin

A Poetry plugin to automatically load environment variables from .env files

poetry-dotenv-plugin v0.2.0 141.3K downloads/30d#11,242 on PyPI158
Permissive license MIT DORMANT released

What it is and what it does

Poetry Dotenv Plugin is a Poetry plugin that automatically injects environment variables from `.env` files into the environment before Poetry commands execute. It wraps python-dotenv to handle variable expansion and interpolation, making it a drop-in replacement for users migrating from Pipenv who relied on automatic `.env` loading. The plugin integrates via Poetry's event handler system and can be controlled through environment variables like POETRY_DOTENV_LOCATION and POETRY_DONT_LOAD_ENV, mirroring Pipenv's interface for ease of transition.

The plugin is lightweight, requiring only Poetry and python-dotenv as runtime dependencies. It supports Python 3.7 and later, and by default overrides existing environment variables—though this can be disabled by setting POETRY_DOTENV_DONT_OVERRIDE to true. Installation is straightforward via `poetry self add`, and it requires no additional configuration beyond having a `.env` file in your project.

Use it for:

  • Migrating from Pipenv to Poetry while preserving existing `.env` loading workflows without code changes.
  • Automatically loading development secrets and configuration from `.env` files during local Poetry runs.
  • Using POSIX variable expansion in `.env` files (e.g., `${VAR}` syntax) via python-dotenv's interpolation support.
  • Controlling `.env` loading behavior per project using POETRY_DOTENV_LOCATION and POETRY_DONT_LOAD_ENV environment variables.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

A Poetry plugin that automatically loads environment variables from `.env` files before Poetry commands run, delegating to python-dotenv for variable expansion and interpolation.

Yes, if you use Poetry and rely on `.env` files for local development. The plugin is simple, low-friction to install, and solves a common workflow gap for Pipenv users switching to Poetry. However, note that maintenance is dormant (last release July 2023); if you need active support or compatibility with very recent Poetry versions, verify compatibility first or consider alternatives.

Install

poetry-dotenv-plugin on PyPI

pip

pip install poetry-dotenv-plugin

uv

uv add poetry-dotenv-plugin

poetry

poetry add poetry-dotenv-plugin

Installing poetry-dotenv-plugin

Before you install

Low friction: pure Python wheel with only two runtime dependencies (poetry and python-dotenv). Maintenance is dormant—last release was 2023-07-16, over a year ago, though the repo remains active with no archived flag and a recent commit on 2024-07-19.

License in practice

MIT license (permissive) places no restrictions on use, modification, or distribution in your own projects.

Quickstart

poetry self add poetry-dotenv-plugin

# Then in your project with a .env file:
poetry run python -c 'import os; print(os.environ.get("MY_ENV_VAR"))'

Requires Poetry to be installed and a `.env` file present in your project directory.

Verify before relying

  • Whether the plugin works correctly with Poetry versions released after 2024-07-19 (last commit date).
  • Current compatibility with the latest python-dotenv release and any breaking changes in its API.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.7,<4)
Install friction low — pure-Python wheel
Runtime dependencies 2 — poetry, python-dotenv
Maintenance dormant — 1,125 days since the last release
Last repo commit
First released
Downloads 141,326/month — #11,242 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: poetry_dotenv_plugin-0.2.0-py3-none-any.whl

Keywords: poetry, poetry-plugin, plugin, dotenv

License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software DevelopmentTopic :: System :: Systems AdministrationTopic :: Utilities

Tags

poetry dotenv pluginload env files poetrypoetry environment variables.env file poetrypoetry plugin dotenvautomatic env loading poetrypoetry pipenv migration
poetry-plugindotenv-loaderpipenv-migration

More Software Development packages