JoseRZapata
data-science-project-template
Python

A modern template for data science projects with all the necessary tools for experiment, development, testing, and deployment. From notebooks to production.

Last updated Jul 7, 2026
59
Stars
9
Forks
2
Issues
+1
Stars/day
Attention Score
72
Language breakdown
Python 46.2%
Makefile 35.7%
Jupyter Notebook 18.1%
โ–ธ Files click to expand
README

Data science project template

uv Ruff pre-commit security: bandit Checked with mypy pages-build-deployment CI codecov


A modern template for data science projects with all the necessary tools for experiment, development, testing, and deployment. From notebooks to production.

โœจ๐Ÿ“šโœจ Documentation:

Source Code:


Features

  • Dependency management with [UV]
  • Virtual environment management with [UV]
  • Linting with [pre-commit] and [Ruff]
  • Continuous integration with [GitHub Actions]
  • Documentation with [mkdocs] and [mkdocstrings] using the mkdocs-materialtheme
  • Automated dependency updates with [Dependabot]
  • Code formatting with [Ruff]
  • Import sorting with [Ruff] using isort rule.
  • Testing with [pytest]
  • Code coverage with [Coverage.py]
  • Coverage reporting with [Codecov]
  • Static type-checking with [mypy]
  • Security audit with [Ruff] using bandit rule.
  • Manage project labels with [GitHub Labeler]

Table of Contents - Features - ๐Ÿ“ Creating a New Project - ๐Ÿ‘ Recommendations - ๐Ÿช๐Ÿฅ‡ Via Cruft - (recommended) - ๐Ÿช Via Cookiecutter - ๐Ÿ”— Linking an Existing Project - ๐Ÿ—ƒ๏ธ Project structure - โœจ Features and Tools - ๐Ÿš€ Project Standardization and Automation - ๐Ÿ”จ Developer Workflow Automation - ๐ŸŒฑ Conditionally Rendered Python Package or Project Boilerplate - ๐Ÿ”ง Maintainability - ๐Ÿท๏ธ Type Checking and Data Validation - โœ… ๐Ÿงช Testing/Coverage - ๐Ÿšจ Linting - ๐Ÿ” Code quality - ๐ŸŽจ Code formatting - ๐Ÿ‘ท CI/CD - Automatic Dependency updates - Dependency Review in PR - Pre-commit automatic updates - ๐Ÿ”’ Security - ๐Ÿ” Static Application Security Testing (SAST) - โŒจ๏ธ Accessibility - ๐Ÿ”จ Automation tool (Makefile) - ๐Ÿ“ Project Documentation - ๐Ÿ—ƒ๏ธ Templates - Good practices - References

๐Ÿ“ Creating a New Project

๐Ÿ‘ Recommendations

It is highly recommended to use managers for the python versions, dependencies and virtual environments.

This project uses [UV], a extremely fast tool to replace pip, pip-tools, [Pipx], [Poetry], [Pyenv], twine, virtualenv, and more.

๐ŸŒŸ Check how to setup your environment:

๐Ÿช๐Ÿฅ‡ Via [Cruft] - (recommended)

title="install cruft"

Install cruft in a isolated environment using uv

uv tool install cruft

Or Install with pip

pip install --user cruft # Install cruft on your path for easy access

title="create project"
cruft create https://github.com/JoseRZapata/data-science-project-template

then inside the project folder, init git and uv environment using [Make]:

title="install project"
make init_git
make install_env
source .venv/bin/activate

๐Ÿช Via [Cookiecutter]

title="install cookiecutter"

uv tool install cookiecutter # Install cruft in a isolated environment

Or Install with pip

pip install --user cookiecutter # Install cookiecutter on your path for easy access

title="create project"
cookiecutter gh:JoseRZapata/data-science-project-template

Note: Cookiecutter uses gh: as short-hand for https://github.com/

๐Ÿ”— Linking an Existing Project

If the project was originally installed via [Cookiecutter], you must first use [Cruft] to link the project with the original template:

cruft link https://github.com/JoseRZapata/data-science-project-template

Then/else:

cruft update

๐Ÿ—ƒ๏ธ Project structure

Folder structure for data science projects why?

.
โ”œโ”€โ”€ .code_quality
โ”‚ย ย  โ”œโ”€โ”€ mypy.ini                        # mypy configuration
โ”‚ย ย  โ””โ”€โ”€ ruff.toml                       # ruff configuration
โ”œโ”€โ”€ .github                             # github configuration
โ”‚ย ย  โ”œโ”€โ”€ actions
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ python-poetry-env
โ”‚ย ย  โ”‚ย ย      โ””โ”€โ”€ action.yml              # github action to setup python environment
โ”‚ย ย  โ”œโ”€โ”€ dependabot.md                   # github action to update dependencies
โ”‚ย ย  โ”œโ”€โ”€ pullrequesttemplate.md        # template for pull requests
โ”‚ย ย  โ””โ”€โ”€ workflows                       # github actions workflows
โ”‚ย ย      โ”œโ”€โ”€ ci.yml                      # run continuous integration (tests, pre-commit, etc.)
โ”‚ย ย      โ”œโ”€โ”€ dependency_review.yml       # review dependencies
โ”‚ย ย      โ”œโ”€โ”€ docs.yml                    # build documentation (mkdocs)
โ”‚ย ย      โ””โ”€โ”€ pre-commit_autoupdate.yml   # update pre-commit hooks
โ”œโ”€โ”€ .vscode                             # vscode configuration
|   โ”œโ”€โ”€ extensions.json                 # list of recommended extensions
|   โ”œโ”€โ”€ launch.json                     # vscode launch configuration
|   โ””โ”€โ”€ settings.json                   # vscode settings
โ”œโ”€โ”€ conf                                # folder configuration files
โ”‚ย ย  โ””โ”€โ”€ config.yaml                     # main configuration file
โ”œโ”€โ”€ data
โ”‚ย ย  โ”œโ”€โ”€ 01_raw                          # raw immutable data
โ”‚ย ย  โ”œโ”€โ”€ 02_intermediate                 # typed data
โ”‚ย ย  โ”œโ”€โ”€ 03_primary                      # domain model data
โ”‚ย ย  โ”œโ”€โ”€ 04_feature                      # model features
โ”‚ย ย  โ”œโ”€โ”€ 05modelinput                  # often called 'master tables'
โ”‚ย ย  โ”œโ”€โ”€ 06_models                       # serialized models
โ”‚ย ย  โ”œโ”€โ”€ 07modeloutput                 # data generated by model runs
โ”‚ย ย  โ”œโ”€โ”€ 08_reporting                    # reports, results, etc
โ”‚ย ย  โ””โ”€โ”€ README.md                       # description of the data structure
โ”œโ”€โ”€ docs                                # documentation for your project
โ”‚ย ย  โ”œโ”€โ”€ index.md                        # documentation homepage
โ”œโ”€โ”€ models                              # store final models
โ”œโ”€โ”€ notebooks
โ”‚ย ย  โ”œโ”€โ”€ 1-data                          # data extraction and cleaning
โ”‚ย ย  โ”œโ”€โ”€ 2-exploration                   # exploratory data analysis (EDA)
โ”‚ย ย  โ”œโ”€โ”€ 3-analysis                      # Statistical analysis, hypothesis testing.
โ”‚ย ย  โ”œโ”€โ”€ 4-feat_eng                      # feature engineering (creation, selection, and transformation.)
โ”‚ย ย  โ”œโ”€โ”€ 5-models                        # model training, evaluation and hyperparameter tuning.
โ”‚ย ย  โ”œโ”€โ”€ 6-interpretation                # model interpretation
โ”‚ย ย  โ”œโ”€โ”€ 7-deploy                        # model packaging, deployment strategies.
โ”‚ย ย  โ”œโ”€โ”€ 8-reports                       # story telling, summaries and analysis conclusions.
โ”‚ย ย  โ”œโ”€โ”€ notebook_template.ipynb         # template for notebooks
โ”‚ย ย  โ””โ”€โ”€ README.md                       # information about the notebooks
โ”œโ”€โ”€ src                                 # source code for use in this project
โ”‚   โ”œโ”€โ”€ README.md                       # description of src structure
โ”‚   โ”œโ”€โ”€ tmp_mock.py                     # example python file
โ”‚   โ”œโ”€โ”€ data                            # data extraction, validation, processing, transformation
โ”‚   โ”œโ”€โ”€ model                           # model training, evaluation, validation, export
โ”‚   โ”œโ”€โ”€ inference                       # model prediction, serving, monitoring
โ”‚   โ””โ”€โ”€ pipelines                       # orchestration of pipelines
โ”‚       โ”œโ”€โ”€ feature_pipeline            # transforms raw data into features and labels
โ”‚       โ”œโ”€โ”€ training_pipeline           # transforms features and labels into a model
โ”‚       โ””โ”€โ”€ inference_pipeline          # takes features and a trained model for predictions
โ”œโ”€โ”€ tests                               # test code for your project
โ”‚   โ”œโ”€โ”€ test_mock.py                    # example test file
โ”‚   โ”œโ”€โ”€ data                            # tests for data module
โ”‚   โ”œโ”€โ”€ model                           # tests for model module
โ”‚   โ”œโ”€โ”€ inference                       # tests for inference module
โ”‚   โ””โ”€โ”€ pipelines                       # tests for pipelines module
โ”œโ”€โ”€ .editorconfig                       # editor configuration
โ”œโ”€โ”€ .gitignore                          # files to ignore in git
โ”œโ”€โ”€ .pre-commit-config.yaml             # configuration for pre-commit hooks
โ”œโ”€โ”€ codecov.yml                         # configuration for codecov
โ”œโ”€โ”€ Makefile                            # useful commands to setup environment, run tests, etc.
โ”œโ”€โ”€ mkdocs.yml                          # configuration for mkdocs documentation
โ”œโ”€โ”€ pyproject.toml                      # dependencies and configuration project file
โ”œโ”€โ”€ uv.lock                             # locked dependencies
โ””โ”€โ”€ README.md                           # description of your project

โœจ Features and Tools

๐Ÿš€ Project Standardization and Automation

๐Ÿ”จ Developer Workflow Automation

  • Python packaging, dependency management and environment management
with [UV] - why use a management, (uv is a replacement for poetry)
  • Project workflow orchestration
with [Make] as an interface shim) - Self-documenting Makefile; just type make on the command line to display auto-generated documentation on available targets:
  • Automated Cookiecutter template synchronization with [Cruft] - why?
  • Code quality tooling automation and management with [pre-commit]
  • Continuous integration and deployment with [GitHub Actions]
  • Project configuration files with [Hydra] - why?

๐ŸŒฑ Conditionally Rendered Python Package or Project Boilerplate

  • Optional: [Jupyter] support

๐Ÿ”ง Maintainability

๐Ÿท๏ธ Type Checking and Data Validation

  • Static type-checking with [Mypy]

โœ… ๐Ÿงช Testing/Coverage

  • Testing with [Pytest]
  • Code coverage with [Coverage.py]
  • Coverage reporting with [Codecov]

๐Ÿšจ Linting

๐Ÿ” Code quality
  • [Ruff] An extremely fast (10x-100x faster) Python linter and code formatter, written in Rust.
- Replacement for [Pylint], [Flake8] (including major plugins) and more linters under a single, common interface - Secrets with detect-secrets - Large files with check-added-large-files - Files that contain merge conflict strings.check-merge-conflict
๐ŸŽจ Code formatting
  • [Ruff] An extremely fast (10x-100x faster) Python linter and code formatter, written in Rust.
- Replacement for [Black], [isort], [pyupgrade] and more formatters under a single, common interface
  • General file formatting:
- end-of-file-fixer - pretty-format-json - (trim) trailing-whitespace - check-yaml

๐Ÿ‘ท CI/CD

Automatic Dependency updates
  • This is a replacement for pip-audit , In your local environment, If you want to check for vulnerabilities in your dependencies you can use [pip-audit]_.
Dependency Review in PR
  • Dependency Review with [dependency-review-action], This action scans your pull requests for dependency changes, and will raise an error if any vulnerabilities or invalid licenses are being introduced.
Pre-commit automatic updates
  • Automatic updates with [GitHub Actions] workflow .github/workflows/pre-commit_autoupdate.yml

๐Ÿ”’ Security

๐Ÿ” Static Application Security Testing (SAST)

  • Code vulnerabilities with [Bandit] using [Ruff]

โŒจ๏ธ Accessibility

๐Ÿ”จ Automation tool (Makefile)

Makefile to automate the setup of your environment, the installation of dependencies, the execution of tests, etc. in terminal type make to see the available commands

Target                Description
-------------------   ----------------------------------------------------
check                 Run code quality tools with pre-commit hooks.
docs_test             Test if documentation can be built without warnings or errors
docs_view             Build and serve the documentation
init_env              Install dependencies with uv and activate env
init_git              Initialize git repository
installdatalibs     Install pandas, scikit-learn, Jupyter, seaborn
pre-commit_update     Update pre-commit hooks
test                  Test the code with pytest and coverage

๐Ÿ“ Project Documentation

  • Documentation building
with [MkDocs] - Tutorial - Powered by mkdocs-material - Rich automatic documentation from type annotations and docstrings (NumPy, Google, etc.) with [mkdocstrings]

๐Ÿ—ƒ๏ธ Templates

  • [Pull Request template]
  • [Notebook template]

Good practices


References


[Bandit]: https://github.com/PyCQA/bandit [Black]: https://github.com/psf/black [Codecov]: https://codecov.io/ [Cookiecutter]:https://cookiecutter.readthedocs.io/en/stable/ [Coverage.py]: https://coverage.readthedocs.io/ [Cruft]: https://cruft.github.io/cruft/ [Dependabot]: https://github.com/dependabot/dependabot-core [dependency-review-action]: https://github.com/actions/dependency-review-action [Flake8]:https://github.com/PyCQA/flake8 [GitHub Actions]: https://github.com/features/actions [Github Labeler]: https://github.com/marketplace/actions/github-labeler [hydra]: https://hydra.cc/ [isort]: https://github.com/PyCQA/isort [Jupyter]: https://jupyter.org/ [Make]: https://www.gnu.org/software/make/manual/make.html [mkdocs]: https://www.mkdocs.org/ [mkdocstrings]: https://mkdocstrings.github.io/ [Mypy]: http://mypy-lang.org/ [Notebook template]: https://github.com/JoseRZapata/data-science-project-template/blob/main/{{cookiecutter.reponame}}/notebooks/notebooktemplate.ipynb [Pipx]:https://pipx.pypa.io/stable/ [Poetry]: https://python-poetry.org/ [pre-commit]: https://pre-commit.com/ [Pull Request template]: https://github.com/JoseRZapata/data-science-project-template/blob/main/{{cookiecutter.reponame}}/.github/pullrequest_template.md [Pyenv]:https://github.com/pyenv/pyenv [Pylint]:https://github.com/PyCQA/pylint [Pytest]: https://docs.pytest.org/en/latest/ [pyupgrade]: https://github.com/asottile/pyupgrade [Ruff]: https://docs.astral.sh/ruff/ [UV]: https://docs.astral.sh/uv/

๐Ÿ”— More in this category

ยฉ 2026 GitRepoTrend ยท JoseRZapata/data-science-project-template ยท Updated daily from GitHub