Skip to content


Python Project Template

Python Project Template provides a ready-to-use structure for Python projects, integrating best practices for code quality, testing and more. It helps developers start new projects quickly with a maintainable and professional foundation.

Warning

This template is configured for Linux x86_64 systems. For other platforms, you may need to adjust the environments and required-environments settings in pyproject.toml.

Features

The template includes Ruff and Mypy for linting and type checking, keeping code clean and consistent. Bandit handles security scanning to detect potential vulnerabilities, while Complexipy identifies complex functions and modules. Unit testing is covered by Pytest, and documentation is automated with MkDocs deployed via GitHub Pages. Finally, GitHub Actions ties everything together by automating linting, testing, and documentation deployment in CI/CD.

Getting Started

Before starting, ensure that you have required Python installed and a virtual environment set up. It is recommended to create an isolated environment to manage dependencies cleanly. Additionally, ensure that uv is installed in your environment to handle grouped dependency installations.

Generate Your Project — Use Cookiecutter to create a new project from the template and follow the prompts to configure project metadata, package name, and other options:

cookiecutter https://github.com/danibcorr/python-project-template.git

Install Dependencies — Activate your virtual environment and install all dependencies using the included Makefile. This installs development, testing, and documentation tools as defined in pyproject.toml:

make setup

Run the Pipeline — Execute the quality pipeline, which includes linting, type checking, complexity checks, and test execution:

make pipeline

Run the Full Workflow (Optional) — To perform a complete setup including dependency installation, full quality checks, and local documentation preview, ensuring that the project environment is fully prepared for development and validation:

make all