Workbench python template: a tagline that sounds hip and cool and convinces you
This is a poetry package template used for creating python packages using modern development tools.
This package template was adapted from the py-pkgs cookiecutter template by Thomas Beuzen.
Features
This template uses the following tools for development, code quality & testing:
Poetry(obviously)Pre-committo run static checks on codeBlackfor code formattingIsortfor sorting dependenciesCodespellfor correcting spellingRufffor lintingPyproject-fmtto format pyproject.tomlInterrogatefor docstring coverageDeptryto check for possible package conflictsMypyfor type hint checkingNox&nox-poetryfor testing across python versionsInvokefor defining re-usable / useful commandsPython-semantic-releasefor versioning based on git commitssync_with_poetrypre-commit hook to keep parity between dev package versions and pre-commit revs.
Additionally, this package template contains starter code using:
typerfor creating CLIspydantic_yamlfor creating/parsing YAML config files
Recipes
Depending on how you want to use the template, you can find additional setup in the recipes subsection of the docs.
Usage
Please see the documentation for more detail on using workbench-package-template. We provide the fundamental steps below:
-
Install
cookiecutter: -
Generate a Python package structure using
workbench-package-template:
First steps
-
Create a GH repository and do the following:
-
Enable GH pages by going to Settings > Pages and selecting Source as 'GitHub actions', then selecting 'Static HTML'. Cancel the action that is created for you (this is already incorporated in the template).

-
Run
poetry install -
Check in the changes and push to main with the commit message 'ci skip'
-
Run
poetry shell -
Run
invoke set-up-pre-committo set up the pre-commit hooks
Contributing
Interested in contributing? Check out the Contributing Guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.
License
py-pkgs-cookiecutter was created by Tomas Beuzen and Tiffany Timbers. It is licensed under the terms of the BSD license.
Acknowledgements
py-pkgs-cookiecutter was originally developed for use in the University of British Columbia's (UBC) Master of Data Science_ program (MDS). It was inspired by the pyOpenSci cookiecutter template.