Skip to content

habedi/template-python-project

Repository files navigation

Python ML/DS Project Template

Python Project Template

Tests Code Coverage Code Quality Python Version Documentation License Managed with Poetry Managed with uv Makefile


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.

Features

  • 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.

Prerequisites

  • Python >= 3.10
  • Poetry 2.0+ (or any other modern Python dependency manager like uv)
  • GNU Make

Usage

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.

Structure

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

Contributing

See CONTRIBUTING.md for details on how to make a contribution.

License

This template is licensed under the MIT License (LICENSE or https://opensource.org/licenses/MIT)

About

A template for data science and machine learning projects in Python 🐍

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks