DevBento logoDevBento
Tools/.gitignore Generator/Gitignore for Python

Gitignore for Python

Generate a complete .gitignore for Python projects. Covers __pycache__, virtualenvs, env files, build output, and IDE settings.

Languages & Runtimes
Editors & IDEs
Operating Systems
Frameworks & Tools
.gitignore1 template · 35 rules
# 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
Send to:
Related Tools
.git.gitignore Generator
Generate .gitignore files for any project stack. Select from 30+ templates for languages, editors, and operating systems, then download or copy.
+/-Diff Checker
Compare two blocks of text side by side or inline with character-level highlighting. Find additions, removals, and changes instantly in your browser.

Gitignore for Python

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.

What the Template Ignores

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

How to Use

  1. The tool opens with the Python template preselected
  2. Add companion templates for your editor and OS
  3. Click Generate, copy the result, and save it as .gitignore in your project root
  4. Commit it together with requirements.txt or pyproject.toml

Virtualenv Layout Tip

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.

© 2026 devbento.dev · built local-firstAll ToolsChangelog