Generate a complete .gitignore for Python projects. Covers __pycache__, virtualenvs, env files, build output, and IDE settings.
# Python __pycache__/ *.py[codz] *$py.class *.so .Python dist/ build/ develop-eggs/ downloads/ *.egg-info/ *.egg .eggs/ wheels/ *.whl .venv/ venv/ env/ .env MANIFEST .mypy_cache/ .ruff_cache/ .pytest_cache/ .hypothesis/ htmlcov/ .coverage .coverage.* coverage.xml .tox/ .nox/ .ipynb_checkpoints __pypackages__/ .pdm-python .pdm-build/ celerybeat-schedule* cython_debug/ # Generated with devbento.dev/tools/gitignore-generator
This example generates a complete .gitignore for Python work: scripts, Django or FastAPI services, data projects, and packages. It covers bytecode, virtual environments, packaging output, secrets, and the caches of pytest, mypy, ruff, tox, and Jupyter.
| Pattern | Reason |
|---|---|
| pycache/, *.py[codz] | Compiled bytecode, regenerated on import |
| .venv/, venv/, env/ | Virtual environments, rebuilt from requirements |
| *.egg-info/, *.egg, dist/, build/, wheels/, *.whl | Packaging artifacts from setuptools and pip |
| .env | Secrets and local config |
| .pytest_cache/, .hypothesis/, .tox/, .nox/ | Test runner state |
| .mypy_cache/, .ruff_cache/ | Type checker and linter caches |
| .coverage, coverage.xml, htmlcov/ | Coverage data and reports |
| .ipynb_checkpoints | Jupyter autosave files |
Keep every project venv at .venv/ inside the project folder and use one name everywhere. Then a single .venv/ rule protects all your repos, and onboarding is always python -m venv .venv followed by pip install -r requirements.txt.
For related workflows, compare ignore files with the Diff Checker or build the full file in the Gitignore Generator.
Nothing you paste leaves this tab. Every tool runs entirely in your browser — no upload, no server, no account.