This repository provides a Cookiecutter template for bootstrapping small to medium Python libraries with a modern local workflow.
The template is optimized for:
- fast local setup with
uv - standard Python packaging metadata in
pyproject.toml - simple quality checks that are easy to explain to new contributors
- docs that help a project feel usable immediately after generation
Generated projects use uv as the default project manager. In practice that means:
uv synccreates and updates the local environmentuv run ...executes commands inside the managed environment- dependency groups are defined in
pyproject.toml
The generated package uses hatchling as the build backend. It keeps the packaging configuration compact and works cleanly with uv.
The template follows current PyPA guidance by including:
- SPDX license expressions in
project.license license-filesmetadata- standardized
project.urlslabels such asHomepage,Repository,Issues, andChangelog - dependency groups for dev and test workflows
The code quality stack is intentionally small:
- Ruff handles linting and formatting
- Pytest handles testing
- pre-commit wires the checks into git hooks
The generated project includes two levels of onboarding:
README.md: short project overview and the most common commandsGETTING_STARTED.md: minimal step-by-step setup guide that explains what each command does
CONTRIBUTING.md then expands that into a maintainer-friendly workflow.
When changing commands or tooling:
- Update the generated project files in
{{cookiecutter.directory_name}}/ - Update this repository README so the public usage instructions stay accurate
- Check the post-generation hook message so it matches the new workflow
- Keep the generated docs internally consistent
After editing the template, verify:
cookiecutter . --no-input
cd MyPackageFolder
uv sync
uv run pytest
uv run ruff check .
uv run python -m buildIf any command changes, update both the repo docs and the generated docs in the same pass.