A modern Python package cookiecutter.
Features
- Nox for isolated testing
- Modern Python dependency management with uv
- pytest for testing
- Code formatting with ruff (including formatting and import sorting)
- xdoctest to check that examples of use in docstrings work as intended
- typeguard for run-time type checking
- ty for static type checking
- Git pre-commit hooks for code quality:
- Ruff lint/format/sort imports
- check for added large files
- check TOML
- check YAML
- end of file fixer
- trailing whitespace trimmer
- nbstripout for ensuring notebook outputs are not committed
- pydoclint for checking docstrings agree with function definitions
- Continuous Integration/Continuous Deployment with GitHub Actions
- covers multiple versions of Python, and all three major operating systems
- tests with pytest + Nox
- Test cover with Coverage.py
- Automatic release labeler
- Automatic publishing to PyPI
- Dynamic docs build and deploy using Quarto for a docs site, Quartodoc for automatic API documentation, and GitHub Pages for deployment.
Read more about it in the accompanying blog post.
Prerequisites
- the Python package manager uv
cookiecutterpackage (link here)- an installation of Quarto
How to use this template
To install cookiecutter, which will help you populate the template with details like your project's name, run
uv tool install cookiecutter
To create a new project folder based on this cookie cutter:
uv tool run cookiecutter https://github.com/aeturrell/cookiecutter-python-package.git
The new project folder will appear within the folder you ran the command in.