This is a template for Python projects, specifically designed for machine learning (ML) and data science (DS) projects. I made it to help me have a consistent structure across all my personal and professional projects. I am sharing it here in case it can be useful to others.
- A predefined file and folder layout that should be suitable for most ML and DS projects.
- Easy dependency and environment management with Poetry, uv, or any other modern Python dependency manager.
- Extra configuration files for various tasks like linting, formatting, testing, etc.
- Comes with a lot of quality-of-life features to help you get started quickly, like a
Makefile
and GitHub Actions workflows for common tasks.
Python
>= 3.10Poetry 2.0+
(or any other modern Python dependency manager likeuv
)GNU Make
Use the Use this template
button on GitHub to create a new repository based on this template.
Modify the README.md
file and other files as needed.
Run make help
to see all available commands for managing different tasks.
template-python-project/
βββ scripts/ # Helper scripts for various tasks
βββ data/ # Raw and processed data files
βββ notebooks/ # Jupyter notebooks
βββ src/ # Source code for the project
βββ models/ # ML models and model artifacts
βββ tests/ # Project tests
βββ pyproject.toml # Python project configuration
βββ LICENSE # Project license file
βββ docs/ # Project documentation
βββ Makefile # Makefile for managing development tasks
See CONTRIBUTING.md for details on how to make a contribution.
This template is licensed under the MIT License (LICENSE or https://opensource.org/licenses/MIT)