GitHub

A modern Python package cookiecutter.

The logo for the cookiecutter Python package

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

Read more about it in the accompanying blog post.

Prerequisites

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.

Read the original on github.com ↗