Metadata-Version: 2.4
Name: envdoc
Version: 0.3.0
Summary: Scan Python codebases for env var usage and auto-generate .env.example + Markdown config reference
Project-URL: Homepage, https://github.com/Yanflare/envdoc
Project-URL: Repository, https://github.com/Yanflare/envdoc
Project-URL: Issues, https://github.com/Yanflare/envdoc/issues
Project-URL: Changelog, https://github.com/Yanflare/envdoc/blob/main/CHANGELOG.md
Author-email: Yanflare <yanakiewkr@gmail.com>
License: MIT
License-File: LICENSE
Keywords: cli,devtools,documentation,dotenv,environment
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Documentation
Classifier: Topic :: Utilities
Requires-Python: >=3.10
Requires-Dist: libcst>=1.1.0
Requires-Dist: pathspec>=0.12.0
Requires-Dist: rich>=13.0.0
Requires-Dist: typer>=0.12.0
Provides-Extra: dev
Requires-Dist: mypy>=1.10.0; extra == 'dev'
Requires-Dist: pytest-cov>=5.0.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: ruff>=0.4.0; extra == 'dev'
Description-Content-Type: text/markdown

# envdoc

> Scan your Python codebase for environment variable usage. Auto-generate `.env.example` and a Markdown config reference.

[![CI](https://github.com/Yanflare/envdoc/actions/workflows/ci.yml/badge.svg)](https://github.com/Yanflare/envdoc/actions/workflows/ci.yml)
[![PyPI](https://img.shields.io/pypi/v/envdoc)](https://pypi.org/project/envdoc/)
[![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-blue)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/license-MIT-green)](LICENSE)

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

```bash
pip install envdoc
```

## Usage

```bash
# 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

```yaml
- 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

- [x] Core scanner: `os.getenv`, `os.environ`
- [ ] [#2](../../issues/2) Pydantic `BaseSettings` detection
- [ ] [#3](../../issues/3) `python-dotenv` `load_dotenv` key detection
- [ ] [#4](../../issues/4) pre-commit hook integration
- [ ] [#5](../../issues/5) Nested env access in f-strings
- [ ] [#6](../../issues/6) GitHub Action wrapper

---

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md).

## License

MIT — see [LICENSE](LICENSE).
