cat > .gitignore << 'EOF'
# Byte-compiled / optimized files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
dist/
build/
*.egg-info/
*.egg
.eggs/

# Virtual environments
venv/
.env
.venv
env/

# IDE files
.vscode/
.idea/
*.swp
*.swo
*~

# OS files
.DS_Store
Thumbs.db

# Testing
.pytest_cache/
.coverage
htmlcov/
.tox/
.mypy_cache/

# Environment variables
.env
.env.local
.env.*.local

# Jupyter
.ipynb_checkpoints/

# Type checking
.pytype/

# Installer logs
pip-log.txt
pip-delete-this-directory.txt
EOF