Scan Python codebases for env var usage and auto-generate .env.example + Markdown config reference
Project description
envdoc
Scan your Python codebase for environment variable usage. Auto-generate
.env.exampleand a Markdown config reference.
Every project has undocumented environment variables. Someone runs it cold, nothing works, and
there's no .env.example to tell them what's missing. envdoc fixes that — it scans your code,
finds every os.getenv, os.environ, and common pattern, and writes the documentation for you.
$ envdoc scan ./src
Found 7 environment variables in 12 files
ANTHROPIC_API_KEY src/llm/client.py:14
DATABASE_URL src/db/connection.py:8
LOG_LEVEL src/app.py:22
PORT src/app.py:31
REDIS_URL src/cache.py:11
SECRET_KEY src/auth.py:9
SENTRY_DSN src/monitoring.py:4
Generated: .env.example
Install
pip install envdoc
Usage
# Scan and write .env.example
envdoc scan ./src
# Markdown config reference (for docs)
envdoc scan ./src --format markdown
# CI mode — exit 1 if .env.example is stale
envdoc scan ./src --check
# Write to a specific file
envdoc scan ./src --output docs/config.md --format markdown
CI integration
- name: Check .env.example is up to date
run: envdoc scan ./src --check
Any new env var added to the codebase without updating .env.example fails the build.
Roadmap
- Core scanner:
os.getenv,os.environ - #2 Pydantic
BaseSettingsdetection - #3
python-dotenvload_dotenvkey detection - #4 pre-commit hook integration
- #5 Nested env access in f-strings
- #6 GitHub Action wrapper
Contributing
See CONTRIBUTING.md.
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file envdoc-0.1.0.tar.gz.
File metadata
- Download URL: envdoc-0.1.0.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7edebb531818bb1bde51a42503c4167940e63833782c81201bb1a4fcda4dc0c
|
|
| MD5 |
a903eb94d02da5cfc8342feb44264cdf
|
|
| BLAKE2b-256 |
36233c40ff3d6198608ce95569a6466c77ef6f80fdd1cedf25c2d214ca530d0f
|
Provenance
The following attestation bundles were made for envdoc-0.1.0.tar.gz:
Publisher:
release.yml on Yanflare/envdoc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
envdoc-0.1.0.tar.gz -
Subject digest:
e7edebb531818bb1bde51a42503c4167940e63833782c81201bb1a4fcda4dc0c - Sigstore transparency entry: 1755748641
- Sigstore integration time:
-
Permalink:
Yanflare/envdoc@d0daafb4ec89f0db318846c3fffdb7ae933d8e6c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Yanflare
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d0daafb4ec89f0db318846c3fffdb7ae933d8e6c -
Trigger Event:
push
-
Statement type:
File details
Details for the file envdoc-0.1.0-py3-none-any.whl.
File metadata
- Download URL: envdoc-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19eeee3a81193f1f697ee31e92ed06f232b01e162019cf0619e9981a9fc9ae7d
|
|
| MD5 |
52acf293071f7cd16bba4b943331d286
|
|
| BLAKE2b-256 |
bb54c2edbc81487ce3d8150b6dbf46ae3113d6df07b997907c446f460f16fac0
|
Provenance
The following attestation bundles were made for envdoc-0.1.0-py3-none-any.whl:
Publisher:
release.yml on Yanflare/envdoc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
envdoc-0.1.0-py3-none-any.whl -
Subject digest:
19eeee3a81193f1f697ee31e92ed06f232b01e162019cf0619e9981a9fc9ae7d - Sigstore transparency entry: 1755748670
- Sigstore integration time:
-
Permalink:
Yanflare/envdoc@d0daafb4ec89f0db318846c3fffdb7ae933d8e6c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Yanflare
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d0daafb4ec89f0db318846c3fffdb7ae933d8e6c -
Trigger Event:
push
-
Statement type: