--- id: poetry-dotenv-plugin version: "0.2.0" license: MIT license_treatment: permissive maintenance: dormant --- # poetry-dotenv-plugin — A Poetry plugin to automatically load environment variables from .env files License: permissive · Maintenance: dormant · Downloads: 141.3K/mo ## 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 above — 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 pip install poetry-dotenv-plugin uv add poetry-dotenv-plugin 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_current - Install friction: low - Maintenance: dormant - Downloads: 141.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags poetry dotenv plugin, load env files poetry, poetry environment variables, .env file poetry, poetry plugin dotenv, automatic env loading poetry, poetry pipenv migration, poetry-plugin, dotenv-loader, pipenv-migration [View on SkillFed](https://skillfed.io/packages/poetry-dotenv-plugin) · [View on PyPI](https://pypi.org/project/poetry-dotenv-plugin/)