Skip to main content

dotenvx

a better dotenv–from the creator of dotenv.

  • run anywhere (cross-platform)
  • multi-environment
  • encrypted envs

 

Quickstart PyPI version

Keep the familiar load_dotenv() entry point with dotenvx loading semantics.

pip install python-dotenvx

The wheel includes the native dotenvx SDK and Rust primitives.

# main.py
import os
from dotenvx import load_dotenv

load_dotenv()  # take environment variables from .env

print(os.getenv("S3_BUCKET"))

You can also parse values without changing the environment:

from dotenvx import dotenv_values

values = dotenv_values(".env")

Encrypted values can be decrypted using DOTENV_PRIVATE_KEY from the environment or a neighboring .env.keys file. For keys in Armor or another custody provider, install a dotenvx CLI with command-sdk and the matching feature on PATH.

 

Loading errors and policy

The main entry points use the shared dotenvx-sdk Rust loader. Errors are printed to stderr and available values still load by default. Use strict=True, or set strictness in the current directory's Dotenvxfile, to raise before changing os.environ. Dotenvxfile required/type/file validation is shared with the CLI. Ignore selected diagnostics with ignore=["DECRYPTION_FAILED"].

The loader returns redaction metadata without changing application values; the adapter does not install application-output redaction hooks.

Deliberately smaller Python API

load_dotenv() and dotenv_values() accept an optional file path, or stream= for text input. Loading supports override=, strict=, and ignore=. Options after the file path are keyword-only. load_dotenvx(path, override=False) remains available and returns the resolved mapping after loading it.

Parsing, expansion, UTF-8 file decoding, and local key discovery belong to the shared Rust loader. Python no longer implements a second parser for bare keys or rewrites dollar signs to disable interpolation. Bare keys without = are ignored; use KEY= for an empty string. Single quotes preserve literal dollars.

The legacy interpolate, encoding, and verbose options, and the no-op find_dotenv(usecwd=...) option, are no longer supported. find_dotenv() still searches upward from the current directory.

Shared file selection

The Rust loader owns file discovery, directory expansion, conventions, and key-based filename inference. Pass one path or a list of paths; use convention="nextjs" or convention="flow", and key_files="custom.keys" when needed. The same file-selection and error-ignore environment variables used by the CLI are supported. find_dotenv() delegates upward searching to Rust.

load_dotenv(convention="nextjs")
load_dotenv([".env.production", ".env"])
load_dotenv("app", key_files="shared/.env.keys")

Metadata

Release files for python-dotenvx 3.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for python-dotenvx 3.0.1
File Actions
python_dotenvx-3.0.1-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details for python_dotenvx-3.0.1-cp38-abi3-win_amd64.whl
python_dotenvx-3.0.1-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.8 abi3 Linux glibc 2.17+ x86-64 Details for python_dotenvx-3.0.1-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
python_dotenvx-3.0.1-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.8 abi3 Linux glibc 2.17+ ARM64 Details for python_dotenvx-3.0.1-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
python_dotenvx-3.0.1-cp38-abi3-macosx_11_0_arm64.whl CPython 3.8 abi3 macOS 11.0+ ARM64 Details for python_dotenvx-3.0.1-cp38-abi3-macosx_11_0_arm64.whl
python_dotenvx-3.0.1-cp38-abi3-macosx_10_12_x86_64.whl CPython 3.8 abi3 macOS 10.12+ x86-64 Details for python_dotenvx-3.0.1-cp38-abi3-macosx_10_12_x86_64.whl

Total release size: 7.0 MB

Release files / python_dotenvx-3.0.1-cp38-abi3-win_amd64.whl

Download URL python_dotenvx-3.0.1-cp38-abi3-win_amd64.whl
Size 1.3 MB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
ef2aa93712e78216ac9abe7a669ece7a387be65c94dfe83ad6e78ed9d52c315e
BLAKE2b-256 checksum
How to use checksums
24734b7dcbdc06e37aca8c5a8b485f9d1abf3c5cc539da18b5b0302990fa2aa9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Release files / python_dotenvx-3.0.1-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL python_dotenvx-3.0.1-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 1.5 MB
Tags CPython 3.8 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
df7022103ed14d5325fa0d51b53abbe1357afb628f4c0fc4bac745199b4b3f7d
BLAKE2b-256 checksum
How to use checksums
2bbcdb8e78a0eb75a0a62a769ecc3393bfdbff918d346e8e56391073ed425a38
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Release files / python_dotenvx-3.0.1-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL python_dotenvx-3.0.1-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 1.5 MB
Tags CPython 3.8 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
6c486be523b03d07ea092237b96a03e7d7136602067c229603b6fb6fa77c388e
BLAKE2b-256 checksum
How to use checksums
6dc9a85c7504d97d94a5ad1f041a636ddb1da5b7e6e0c871f3de365e866a95fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Release files / python_dotenvx-3.0.1-cp38-abi3-macosx_11_0_arm64.whl

Download URL python_dotenvx-3.0.1-cp38-abi3-macosx_11_0_arm64.whl
Size 1.3 MB
Tags CPython 3.8 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f7eb568e82509ea2e953d4810e5f9f4363e8b92de7e21d8b4278dd78c011175a
BLAKE2b-256 checksum
How to use checksums
5d00ec27947bb3cef855ec516d67399f2ad6b9c08a7701433f19a23ca15dcffa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Release files / python_dotenvx-3.0.1-cp38-abi3-macosx_10_12_x86_64.whl

Download URL python_dotenvx-3.0.1-cp38-abi3-macosx_10_12_x86_64.whl
Size 1.4 MB
Tags CPython 3.8 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
cd0584b4fca66a78a8d1697ee1f0bda81d938251ffffc52ff966c09b98a30684
BLAKE2b-256 checksum
How to use checksums
b5af4220818850e583e8bd2f16de33fab3ff57adec6d220acbb4c5fb864aa03a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Security for python-dotenvx 3.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for python_dotenvx-3.0.1-cp38-abi3-win_amd64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page