Skip to content

Cookiecutter PyPackage

Cookiecutter template for a Python package. Powered by Poetry, GitHub actions, and MkDocs-Material.

Introduction

Welcome to cookiecutter-pypackage! The creation of this project was inspired by the want for an easy-to-configure repository setup where everything could be done within GitHub. In the current state, the repositories created from the cookiecutter uses only GitHub for continuous integration and continuous deployment (CI/CD) via GitHub Actions. This allows for developers to create, test, and deploy their package(s) in an easy-to-use and easy-to-maintain way.

File structure

All code developed should go within the directory with your project-name given. The packaging works with a single file of code or multiple modules nested within sub-directories. For an example of structuring that allows for easy imports, check out my bowline package.

Features

This template has the following features:

  • pytest: Unit and coverage testing
  • flake8 and pylint: Python style checks
  • black: Auto-formatted code
  • mypy: Type checking
  • Poetry: Depedency management and packaging
  • GitHub Actions: Automated CI checks, auto-release to PyPi, and automated version bumping (no more Travis needed)
  • MkDocs-Material: Auto-publish documentation to it's own webpage

This is a simple list, for a deep-dive into why and how each feature is used visit feature explanation. If already familiar or just not interested, continue to Getting started.