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.2.0.tar.gz (12.1 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.2.0-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for envdoc-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d32435d78943e1e2f6eea9593d292b05061aaaa0d3e54d477cb93b7cdaf840a6
MD5 3bd6c59541e5096184f059f48c259e6a
BLAKE2b-256 ec03b373aa85741c54bafd9095096a7490074ac5ae6c1b0e8e33bb29e0130d33

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: envdoc-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.9 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 71019f05b8f18bdbce2212779162589a8feef5b809564f02e420aae548a973c0
MD5 ac29920058493d0cf41db386a134ac98
BLAKE2b-256 0b775d185b5e39a9026429e702872776d86d29bc763dda9ab5eea31f3826df2b

See more details on using hashes here.

Provenance

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