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.3.0.tar.gz (13.7 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.3.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file envdoc-0.3.0.tar.gz.

File metadata

  • Download URL: envdoc-0.3.0.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for envdoc-0.3.0.tar.gz
Algorithm Hash digest
SHA256 190307b4ef65b6e80b786e88507b3780673876e654fb47a9bafb7b51d74f4f2b
MD5 876d9b5a94eb37ec08393c7ad58600c6
BLAKE2b-256 ca105162867a217da64464b624e27693f8379b6186cdd0cdbf11007730512b9b

See more details on using hashes here.

Provenance

The following attestation bundles were made for envdoc-0.3.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.3.0-py3-none-any.whl.

File metadata

  • Download URL: envdoc-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 9.6 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 837b3efc0212fe8781787b2570e8272cd18af8a84771935f93cc748e59f9d1bf
MD5 163699644d1f24b9dd61eef1f920f4a5
BLAKE2b-256 ac37e64a8d3c02272f4bb4feefc22fda361cdd684ae69c90e2caec358f2ad145

See more details on using hashes here.

Provenance

The following attestation bundles were made for envdoc-0.3.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