python-best-practices
Modern Python standards (uv, Ruff, strict typing, Pydantic v2, Polars, async I/O). Use when writing or reviewing Python, pyproject.toml, FastAPI, scripts, data pipelines, or when the user mentions uv,
SKILL.mdskills/python/SKILL.md
GitHubPython best practices
Project-specific rules: reference.md (full guide, French).
Quick rules
- Tooling:
uvfor deps;ruff check --fix+ruff formatafter edits. Layout:src/package. - Types: Annotate all parameters and returns; Pydantic v2 for external/config data.
- Logic: Prefer
match/ dict dispatch over deepif/elif; generators for large streams. - I/O:
async/await(AnyIO) for network/DB/files; Polars lazy API for new data work. - Agent-facing: Google-style docstrings; never
except Exception: pass— explicit errors.
Verify before done
From repo root, run what exists in pyproject.toml / Makefile:
uv run ruff check .
uv run ruff format --check .
uv run pytest
If commands differ, read project config first — do not invent tooling.