Skip to main content

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.example and a Markdown config reference.

CI PyPI Python 3.10+ License: MIT

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 BaseSettings detection
  • #3 python-dotenv load_dotenv key 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

envdoc-0.1.0.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

envdoc-0.1.0-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

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

Hashes for envdoc-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e7edebb531818bb1bde51a42503c4167940e63833782c81201bb1a4fcda4dc0c
MD5 a903eb94d02da5cfc8342feb44264cdf
BLAKE2b-256 36233c40ff3d6198608ce95569a6466c77ef6f80fdd1cedf25c2d214ca530d0f

See more details on using hashes here.

Provenance

The following attestation bundles were made for envdoc-0.1.0.tar.gz:

Publisher: release.yml on Yanflare/envdoc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for envdoc-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 19eeee3a81193f1f697ee31e92ed06f232b01e162019cf0619e9981a9fc9ae7d
MD5 52acf293071f7cd16bba4b943331d286
BLAKE2b-256 bb54c2edbc81487ce3d8150b6dbf46ae3113d6df07b997907c446f460f16fac0

See more details on using hashes here.

Provenance

The following attestation bundles were made for envdoc-0.1.0-py3-none-any.whl:

Publisher: release.yml on Yanflare/envdoc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page