cookiecutter-pypackage
Cookiecutter template for a Python package.
This repository is a project template for creating Python packages. When you run a single command, it generates a complete folder structure with all the files a publishable Python package needs, pre-configured and ready to use. You answer a few prompts (package name, GitHub username, and similar details) and the template fills everything in.
The template uses a tool called Cookiecutter to handle the generation step. The resulting project comes with uv for managing dependencies and virtual environments, ruff for code formatting and linting, ty for type checking, and pytest for tests across Python versions 3.12, 3.13, and 3.14. There is also a task runner called just that lets you run the full quality check suite with a single command.
Automated workflows for GitHub Actions are included from the start. A CI workflow runs on every push and pull request, checking code quality and running tests across multiple Python versions. A publishing workflow fires when you create a version tag and uploads your package to PyPI using a modern credentials-free approach called Trusted Publishers. A third workflow builds and deploys your documentation to GitHub Pages automatically. All workflows use security-hardened settings with minimal permissions and pinned versions.
Documentation is generated from your code comments and deployed automatically. The template is opinionated: it makes specific tool choices rather than offering a menu of options. If the defaults do not fit your needs, the README points to the fork network where community-maintained variants exist.
The quickstart requires only installing uv and running one command. From that point, pushing to GitHub and following the linked tutorial gets you from an empty package to a first PyPI release.