gitmyhub

hatch

Python ★ 7.2k updated 3d ago

Modern, extensible Python project management

Hatch is the official Python Packaging Authority tool that handles everything from creating a new project to publishing it on PyPI, replacing separate tools for environments, testing, versioning, and building.

PythonHatchlingUVsetup: easycomplexity 2/5

Hatch is a command-line tool for managing Python projects from start to finish. It is part of the Python Packaging Authority (PyPA), the group responsible for maintaining the official Python packaging ecosystem. Rather than juggling separate tools for creating projects, running tests, building packages, and publishing to PyPI, Hatch covers all of those steps in one place.

When starting a new project, Hatch can generate it from a template with standard structure already in place. It manages virtual environments for you, so each project can have its own isolated set of installed packages, and it supports UV for faster package resolution. You can define custom scripts to run common tasks, and Hatch handles test execution with recommended defaults built in. Static analysis is also included, with sensible default settings so you do not need to configure tools from scratch.

When a project is ready to distribute, Hatch handles building it into a package and publishing to PyPI or other package indices. Version management is built in as well, so you can update version numbers without editing files manually.

Hatch is built around the Hatchling build backend, which is the component that constructs distributable packages. Builds are reproducible by default, meaning two builds from the same source produce identical output. The CLI is reported to be roughly two to three times faster than equivalent tooling in this space.

Documentation lives at hatch.pypa.io and covers all features in detail. The project is released under the MIT license.

Where it fits