cat > .gitignore << 'EOF'
# Virtual environments
.venv/
venv/

# Python cache
__pycache__/
*.py[cod]
*.pyo
*.pyd
*.pdb
*.log

# Build artifacts
build/
dist/
*.egg-info/
.eggs/

# IDE / editor
.vscode/
.idea/
*.swp
*.swo

# pytest cache
.pytest_cache/
EOF
