GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - dotenvx/python-dotenvx: a secure dotenv–from the creator of `dotenv`

BranchesTags
Open more actions menu

Latest commit

 

History

63 Commits
63 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
rust
rust
 
 
src/dotenvx
src/dotenvx
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
Cargo.lock
Cargo.lock
 
 
Cargo.toml
Cargo.toml
 
 
DEVELOPMENT.md
DEVELOPMENT.md
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
pyproject.toml
pyproject.toml
 
 

Repository files navigation

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 native dotenvx Rust primitives. No dotenvx executable or post-install download is required.

# 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 are decrypted using DOTENV_PRIVATE_KEY from the environment or a neighboring .env.keys file.

 

Loading errors and policy

The main entry points use the shared dotenvx-ll 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")

About

a secure dotenv–from the creator of `dotenv`

dotenvx.com/open-source

Topics

configdotenvdotenvxenvenvironment

Resources

Readme
BSD-3-Clause license
Activity
Custom properties

Stars

8 stars

Watchers

1 watching

Forks

2 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.