Skip to content

Python project skeleton

Cookiecutter template badge

A cookiecutter template for python projects.


Docs: https://marcohenriques.github.io/python-project-skeleton

Code: https://github.com/marcohenriques/python-project-skeleton


Features included

  • GitHub actions CICD to run formatters, linters, and tests. Also support to build and push docker images
  • Dockerfile to ship python apps
  • Documentation with mkdocs using the beautiful material theme
  • Testing using pytest and several plugins
  • Code formatters using ruff and sqlfluff (SQL)
  • Linters using ruff (check configuration file for enabled plugins), mypy, shellcheck and sqlfluff
  • Python dependencies vulnerabilities scanner using safety
  • Check for issues with dependencies with deptry
  • pre-commit hooks for some validations
  • Makefile to automate some development tasks
  • uv to manage your python versions and dependencies
  • Python package pre-configured with:
  • logging using loguru
  • pydantic to help manage your project settings
  • (optional) CLI example using typer

Requirements

You’ll need to have cookiecutter and uv installed.

Installation

Run the following command to create a new project on your current directory:

cookiecutter gh:marcohenriques/python-project-skeleton

If you want to use a different version of the template use the following command:

cookiecutter gh:marcohenriques/python-project-skeleton -c <VERSION>

where <VERSION> can be the branch, tag or commit of the template repo.

Template inputs

The template asks for the following inputs:

  • project_name: The name of the project. This is used to name the project folder.
  • package_name: The name of the package. This is used to name the package folder.
  • project_description: A short description of the project.
  • author_name: The name of the author.
  • author_email: The email of the author.
  • github_username_or_org_name: The GitHub username or organization name.
  • python_version: The python version to use.
  • include_docker: Whether to include docker support.
  • include_notebooks: Whether to include support for jupyter notebooks.
  • include_docs: Whether to include support for documentation.
  • include_cli: Whether to include support for a command line interface.