NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #36 most downloaded on PyPI
Read key-value pairs from a .env file and set them as environment variables
Last release 3 days ago
01 Oct 2026
Ships fairly regularly
a new release about every 4 months
Most releases are documented
notes for 43 of 52 stable releases
Nothing withdrawn
no release was ever pulled
12 years old
52 releases · first in 2014
dotenv get no longer exits with code 1 for empty string values ( KEY= ) by [ @ShamikOfficial ] in [ #700 ]
dotenv get no longer exits with code 1 for empty string values (KEY=) by [@ShamikOfficial] in [#700]KEY= # comment) is now parsed as an empty string instead of the comment text by [@Noethix55555] in [#663]dotenv run --no-override now expands variable references with the same precedence as load_dotenv(override=False), so a value like ${BASE}/suffix uses the existing BASE from the environment instead of the one from the .env file by [@ROTl24] in [#698]Strip a leading UTF-8 BOM from .env file contents so the first variable is no longer silently lost when the file is saved with BOM (e.g. by some JetBr
One column per quarter.
.env file contents so the first variable is no longer silently lost when the file is saved with BOM (e.g. by some JetBrains IDEs on Windows) by [@h1whelan] in [#640]set_key now escapes backslashes, so values containing them (Windows paths, regular expressions) survive a write/read round-trip. Quoted values ending in an escaped backslash are no longer mis-parsed as an escaped quote, which used to swallow the following lines by [@dchaudhari7177] in [#680]dotenv run now prints a friendly error instead of a traceback when no command is given by [@bbc2] in [#606].env files so repeated dotenv_values/load_dotenv calls no longer re-read the file by [@ReinerBRO] in [#638]Support for Python 3.14, including the free-threaded (3.14t) build. (#)
dotenv run command now forwards flags directly to the specified command by @bbc2 in #607set_key and unset_key behavior when interacting with symlinks by @bbc2 in #790c5dotenv.set_key and dotenv.unset_key used to follow symlinks in some
situations. This is no longer the case. For that behavior to be restored in
all cases, follow_symlinks=True should be used.
In the CLI, set and unset used to follow symlinks in some situations. This
is no longer the case.
dotenv.set_key, dotenv.unset_key and the CLI commands set and unset
used to reset the file mode of the modified .env file to 0o600 in some
situations. This is no longer the case: The original mode of the file is now
preserved. Is the file needed to be created or wasn't a regular file, mode
0o600 is used.
sh in tests by @bbc2 in #612Full Changelog: v1.2.1...v1.2.2
Support reading .env from FIFOs (Unix) by @sidharth-sudhir in #586
Full Changelog: v1.2.0...v1.2.1
pyproject.toml, removed setup.cfg.env from FIFOs (Unix) by [@sidharth-sudhir] in [#586]style: upgrade to use ruff by @theskumar in #567
PYTHON_DOTENV_DISABLED flag to disable load_dotenv (fixes #510) by @matthewfranglen in #569Full Changelog: v1.1.1...v1.2.0
build and pyproject.toml by [@EpicWink] in [#583]load_dotenv() using PYTHON_DOTENV_DISABLED env var. by [@matthewfranglen] in [#569]fix: ensure find_dotenv work reliably on python 3.13 by @theskumar in #563
Full Changelog: v1.1.0...v1.1.1
find_dotenv work reliably on python 3.13 by [@theskumar] in [#563]Add a security policy by @bbc2 in #512
Full Changelog: v1.0.1...v1.1.0
dotenv run, switch to execvpe for better resource management and signal handling ([#523]) by [@eekstunt]find_dotenv and load_dotenv now correctly looks up at the current directory when running in debugger or pdb ([#553] by [@randomseed42])FIx year in release date in changelog.md by @jankislinger in #453
Full Changelog: v1.0.0...v1.0.1
load_dotenv to be reloaded when launched in a separate thread ([#497] by [@freddyaboulton])Handle situations where the cwd does not exist. by @jctanner in #446
Full Changelog: v0.21.1...v1.0.0
Full Changelog: https://github.com/theskumar/python-dotenv/compare/v0.21.1...v1.0.0
Fix IPython test warning about deprecated magic ( #440 by @bbc2 )
get and list commands when env file can't be opened (#441 by @bbc2)magic (#440 by @bbc2)Full Changelog: v0.21.0...v0.21.1
CLI: add support for invocations via 'python -m'. (#395 by @theskumar)
load_dotenv function now returns False. (#388 by @larsks)open instead of io.open. (#389 by @rabinadk1)parse_it to Related Projects by (#410 by @naorlivne)Full Changelog: https://github.com/theskumar/python-dotenv/compare/v0.20.0...v0.21.0
load_dotenv function now returns False. (#388 by @larsks)open instead of io.open. (#389 by @rabinadk1)parse_it to Related Projects by (#410 by @naorlivne)Full Changelog: v0.20.0...v0.21.0
Add encoding (Optional[str]) parameter to get_key, set_key and unset_key. (#379 by [@bbc2])
encoding (Optional[str]) parameter to get_key, set_key and unset_key.
(#379 by [@bbc2])entry_points parameter of setuptools.setup (#376 by
[@mgorny]).Add missing trailing newline before adding new entry with set_key by @bbc2 in https://github.com/theskumar/python-dotenv/pull/361
set_key by @bbc2 in https://github.com/theskumar/python-dotenv/pull/361Full Changelog: https://github.com/theskumar/python-dotenv/compare/v0.19.1...v0.19.2
set_key, add missing newline character before new entry if necessary. (#361 by
[@bbc2])CHANGELOG.md: Fix typos discovered by codespell by @cclauss in https://github.com/theskumar/python-dotenv/pull/350
Full Changelog: https://github.com/theskumar/python-dotenv/compare/v0.19.0...v0.19.1
Require Python 3.5 or a later version. Python 2 and 3.4 are no longer supported. (#341 by @bbc2).
dotenv_path argument of set_key and unset_key now has a type of Union[str, os.PathLike] instead of just os.PathLike (#347 by @bbc2).stream argument of load_dotenv and dotenv_values can now be a text stream (IO[str]), which includes values like io.StringIO("foo") and open("file.env", "r") (#348 by @bbc2).Raise ValueError if quote_mode isn't one of always, auto or never in set_key (#330 by @bbc2).
ValueError if quote_mode isn't one of always, auto or never in set_key (#330 by @bbc2).set_key or dotenv set <key> <value> (#330 by @bbc2):
auto mode, don't add quotes if the value is only made of alphanumeric characters (as determined by string.isalnum).Fixed tests for build environments relying on PYTHONPATH (#318 by @befeleme).
PYTHONPATH (#318 by @befeleme).Make dotenv get only show the value, not key=value (#313 by @bbc2).
dotenv get <key> only show the value, not key=value (#313 by @bbc2).--override/--no-override option to dotenv run (#312 by @zueve and @bbc2).The default value of the encoding parameter for load_dotenv and dotenv_values is now "utf-8" instead of None (#306 by @bbc2).
encoding parameter for load_dotenv and dotenv_values is now "utf-8" instead of None (#306 by @bbc2).override=False (#287 by @bbc2).Add --export option to set to make it prepend the binding with export (#270 by [@jadutter]).
--export option to set to make it prepend the binding with export (#270 by
[@jadutter]).set command create the .env file in the current directory if no .env file was
found (#270 by [@jadutter]).Privilege definition in file over the environment in variable expansion (#256 by [@elbehery95]).
Add support for a Bash-like default value in variable expansion (#248 by [@bbc2]).
Use current working directory to find .env when bundled by PyInstaller (#213 by [@gergelyk]).
.env when bundled by PyInstaller (#213 by
[@gergelyk]).set_key (#236 by [@bbc2]).dotenv run crashing on environment variables without values (#237 by [@yannham]).Add interpolate argument to load_dotenv and dotenv_values to disable interpolation (#232 by [@ulyssessouza]).
interpolate argument to load_dotenv and dotenv_values to disable interpolation
(#232 by [@ulyssessouza]).Fix handling of malformed lines and lines without a value (#222 by [@bbc2]):
Make typing optional (#179 by [@techalchemy]).
Improve interactive mode detection ([@andrewsmith])([#183]).
# as start of comment only if preceded by whitespace.Add type hints and expose them to users ([@qnighy])([#172])
load_dotenv and dotenv_values now accept an encoding parameter, defaults to None
([@theskumar])([@earlbread])([#161])str/unicode inconsistency in Python 2: values are always str now. ([@bbc2])([#121])Fix parsing of variable without a value ([@asyncee])([@bbc2])([#158])
Add support for UTF-8 in unquoted values ([@bbc2])([#148])
Nothing published for this version
Add --version parameter to cli ([@venthur])
--version parameter to cli ([@venthur])Nothing published for this version
Make 'cli' support optional. Use pip install python-dotenv[cli]. ([@theskumar])
pip install python-dotenv[cli]. ([@theskumar])set_key and unset_key only modified the affected file instead of parsing and re-writing file, this causes comments and other file entact as it is.
set_key and unset_key only modified the affected file instead of
parsing and re-writing file, this causes comments and other file
entact as it is.export prefix in the line.load_dotenv and dotenv_values to work with StringIO()) ([@alanjds])([@theskumar])([#78])Remove hard dependency on iPython ([@theskumar])
Add support to override system environment variable via .env. (@milonimrod) (\#63)
Add support for special characters \. (@pjona) (\#60)
Fix issue with single quotes ([@Flimm]) (\#52)
Handle unicode exception in setup.py (\#46)
Fix dotenv list command (@ticosax)
Nothing published for this version
Handle escaped characters and newlines in quoted values. (Thanks @iameugenejo)
Fix find_dotenv - it now start search from the file where this function is called from.
find_dotenv - it now start search from the file where this
function is called from.Add find_dotenv method that will try to find a .env file. (Thanks @isms)
find_dotenv method that will try to find a .env file.
(Thanks @isms)cli: Added -q/--quote option to control the behaviour of quotes around values in .env. (Thanks @hugochinchilla).
-q/--quote option to control the behaviour of quotes
around values in .env. (Thanks
@hugochinchilla).<!-- PR LINKS -->
<!-- contributors -->
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →