Skip to main content

dotenvx

The secure dotenv–from the creator of dotenv.

  • Encrypt
  • Commit
  • Ship

PyPI · Quickstart · Changelog

Quickstart

With uv installed, create a project and add python-dotenvx.

uv init hello-dotenvx
cd hello-dotenvx
uv add python-dotenvx

In an existing pip project, install the same package with python -m pip install python-dotenvx.

Create these two files in the project directory.

# .env
HELLO=World
# index.py
import os
from dotenvx import load_dotenv

load_dotenv()
print(f"Hello {os.environ['HELLO']}")

Run uv run index.py (or python index.py with pip). The script prints Hello World.

Loading files

load_dotenv() loads values into os.environ and preserves existing variables. Pass override=True to replace them or strict=True to raise on loading errors. To read values into a dictionary without changing the environment, use dotenv_values().

from dotenvx import dotenv_values

values = dotenv_values(".env.production")

An explicit path takes precedence. With the default settings and no path argument, the SDK checks DOTENV_FILE, then DOTENV_PATH, then looks for files named by exported private keys (for example, DOTENV_PRIVATE_KEY_PRODUCTION selects .env.production). Otherwise it searches for .env from the working directory up through its parents.

Encrypt and deploy

With the dotenvx CLI installed, run this in the example project to encrypt the values in .env.

dotenvx encrypt

Commit the encrypted .env with your code. Keep the generated .env.keys file out of version control. In production, set DOTENV_PRIVATE_KEY in your deployment environment using the value from .env.keys.

Run the script again. The SDK decrypts HELLO at runtime and the script still prints Hello World.

 

Design

Three widely used and proven primitives make up Dotenvx's design. Git, .env, and secp256k1.

We chose git because it is the best way to deliver digital goods. It is the container ship of the digital world. All code travels on its ships. Why not secrets? Why invent an inferior secrets delivery mechanism when the world class one is right there at your fingertips.

We chose .env because it is the open standard for loading secrets into code. It represents environment variables, the core primitive that all secrets end up injected into at runtime of code.

Lastly, we needed to choose an encryption algorithm. Encryption of the values inside the .env file would allow us to place those values with code, leveraging git's distribution advantages while still following the twelve-factor config – by separating the decryption key from the code (environment).

It was important that we choose a proven, simple, asymmetric standard with small keys. We chose secp256k1, battle-tested by Bitcoin for more than seventeen years. We made cryptography an opinionated choice so developers wouldn't have to. Encryption just worked.

The result is a system built entirely from primitives, developers already understand, and infrastructure they already use. Secrets can travel with code without becoming part of the code. Git distributes them, .env defines how apps consume them, and secp256k1 keeps their values unreadable. The kicker, all this works by setting a single private key on your infrastructure - no more risky async coordination of secrets, no more centralized downtime risk. Your secrets are always just there with your code, ready to be unlocked at runtime.

Read the whitepaper →

 

Metadata

Release files for python-dotenvx 3.1.7

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

Total release size: 8.0 MB

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

Download URL python_dotenvx-3.1.7-cp38-abi3-win_amd64.whl
Size 1.5 MB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
e8a556231da92ad0c454523610ec7b7b666e378d53cee0665f2cda502cd54b67
BLAKE2b-256 checksum
How to use checksums
c9e412cdaf236ca1f7bffcded36d19fdea7d5b24c9561cbcfc357f48c468ce18
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 30, 2026.

Transparency log

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

Download URL python_dotenvx-3.1.7-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 1.7 MB
Tags CPython 3.8 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
d8fe633bce7020cfb07c249ab98645d4e5be8324a64132efb6009abff5cbd28e
BLAKE2b-256 checksum
How to use checksums
8c9af930bfbe0c3f851b4cb44b9435c467a22a0f9c8c3545c4c39d6b1e1e19e5
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 30, 2026.

Transparency log

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

Download URL python_dotenvx-3.1.7-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 1.7 MB
Tags CPython 3.8 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
7b9b2f4f90d2a74f8e83eca3ad02568a5f994ba4bb5a8fa2e8d3d4a30f488b6e
BLAKE2b-256 checksum
How to use checksums
9147169218859f529bb825f7092b357217309e782e4ce3aceeb194ab785133d6
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 30, 2026.

Transparency log

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

Download URL python_dotenvx-3.1.7-cp38-abi3-macosx_11_0_arm64.whl
Size 1.5 MB
Tags CPython 3.8 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
98ce8e5f95d00095632de79d2a711e090a392169b4d67c16106395b1a351575b
BLAKE2b-256 checksum
How to use checksums
011c229ea7e60c2ac9a9bf0bd0e6118279da61f103e9066fe16e53e678cdd3ee
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 30, 2026.

Transparency log

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

Download URL python_dotenvx-3.1.7-cp38-abi3-macosx_10_12_x86_64.whl
Size 1.6 MB
Tags CPython 3.8 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
f32fc3ad496905f60811dc538b8fcc8cba78bb1f6ea0c031c6a9e0e1f111e30a
BLAKE2b-256 checksum
How to use checksums
7447cac4239037f243507897ea091b54252309d4a5c215b50d3c1c4e6eec9dc9
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 30, 2026.

Transparency log

Security for python-dotenvx 3.1.7

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.1.7-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 30, 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.

Release history Release notifications | RSS feed

This release

3.1.7 This release

5 release files Full provenance

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