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.0

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.0
File Actions
python_dotenvx-3.0.0-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details for python_dotenvx-3.0.0-cp38-abi3-win_amd64.whl
python_dotenvx-3.0.0-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.0-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
python_dotenvx-3.0.0-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.8 abi3 Linux glibc 2.17+ ARM64 Details for python_dotenvx-3.0.0-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
python_dotenvx-3.0.0-cp38-abi3-macosx_11_0_arm64.whl CPython 3.8 abi3 macOS 11.0+ ARM64 Details for python_dotenvx-3.0.0-cp38-abi3-macosx_11_0_arm64.whl
python_dotenvx-3.0.0-cp38-abi3-macosx_10_12_x86_64.whl CPython 3.8 abi3 macOS 10.12+ x86-64 Details for python_dotenvx-3.0.0-cp38-abi3-macosx_10_12_x86_64.whl

Total release size: 6.9 MB

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

Download URL python_dotenvx-3.0.0-cp38-abi3-win_amd64.whl
Size 1.2 MB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
c8ea1bae976507cce2fbd3a2485e00d2bcd9d9a8b416e120a99380964c79bc34
BLAKE2b-256 checksum
How to use checksums
5d6bd5bcd08333ac927badf8e9ad39c8ceb6967e1c2031b5ad19ed8b209ae02a
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.0-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL python_dotenvx-3.0.0-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
52ebc7fb312b2553cfda417826e67740ae647e7474dfaceabecfd8b452fc244c
BLAKE2b-256 checksum
How to use checksums
8aef97194291defe906cbf2dab62d1617639e48421761c9c268c7c3fc4490dc1
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.0-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL python_dotenvx-3.0.0-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
1a2d30c85aa5a4190c200b8f431fcb4aab9e6b6a26673ddabcb430b135b53d25
BLAKE2b-256 checksum
How to use checksums
8b566dfb9069fe6a65a0db204f23842c73c2a25d9cfe21b3404071804b9d0fcc
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.0-cp38-abi3-macosx_11_0_arm64.whl

Download URL python_dotenvx-3.0.0-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
c910dd8eeb46bb9ab30f17ca688c685a4046b6655ac41e0966e2386517bb4494
BLAKE2b-256 checksum
How to use checksums
0b9b87e4e4de708ad55288fc2df6f908ade608cb380cff2956a70ff9c5c5ccc5
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.0-cp38-abi3-macosx_10_12_x86_64.whl

Download URL python_dotenvx-3.0.0-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
abf34137b3f1e9a71fee17496d84de32cf5f17be1a55c77d55c593cfc4432d5e
BLAKE2b-256 checksum
How to use checksums
a4753ff13d13830cbd98b1929940cd110a8deb4a4a4e810363bf9a26df835242
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.0

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.0-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