pre-commit for Python: Practical Quality Hooks
Automate fast checks before each commit with pinned pre-commit hooks and the same validation in CI.
Explore our technical articles, practical tutorials, and career guides.
The fuel for your journey in the Python Universe.
Automate fast checks before each commit with pinned pre-commit hooks and the same validation in CI.
Centralize application configuration with pydantic-settings and fail early when required environment values are missing.
Define lightweight contracts with typing.Protocol and accept compatible objects without requiring explicit inheritance.
Coordinate related tasks with asyncio.TaskGroup while understanding results, failures, cancellation, and gather.
Organize shared API logic with FastAPI Depends, Annotated, sub-dependencies, yield, and test overrides.
Build clearer tests with fixtures, temporary files, and monkeypatch without testing mocks instead of behavior.
Turn a DataFrame into an interactive Streamlit dashboard with filters, metrics, charts, and deliberate caching.
Version schema changes with Alembic and SQLAlchemy, reviewing generated migrations before applying them safely.
Use Ruff for linting, import sorting, and formatting with a small configuration and predictable CI checks.
Set up a Python project with uv, a virtual environment, pyproject.toml, and a reproducible lockfile while understanding what changes from pip.
Build lean Python documentation with Sphinx, autodoc, docstrings, and type hints, then generate HTML and automate publishing without needless complexity.
Use Hypothesis with pytest to generate inputs, check invariants, shrink failures, and uncover edge cases that hand-written examples miss.