Repository: drivendataorg/cookiecutter-data-science
Stars: 9787
README.md
Cookiecutter Data Science
_A logical, reasonably standardized but flexible project structure for doing and sharing data science work._


<a target="_blank" href="https://cookiecutter-data-science.drivendata.org/">
<img src="https://img.shields.io/badge/CCDS-Project%20template-328F97?logo=cookiecutter" />
</a>

Cookiecutter Data Science (CCDS) is a tool for setting up a data science project template that incorporates best practices. To learn more about CCDS's philosophy, visit the project homepage.
âšī¸ Cookiecutter Data Science v2 has changed from v1. It now requires installing the new cookiecutter-data-science Python package, which extends the functionality of the cookiecutter templating utility. Use the providedccdscommand-line program instead ofcookiecutter.
Installation
Cookiecutter Data Science v2 requires Python 3.9+. Since this is a cross-project utility application, we recommend installing it with pipx. Installation command options:
With pipx from PyPI (recommended)
pipx install cookiecutter-data-scienceWith pip from PyPI
pip install cookiecutter-data-scienceWith conda from conda-forge (coming soon)
conda install cookiecutter-data-science -c conda-forge
Starting a new project
To start a new project, run:
ccdsThe resulting directory structure
The directory structure of your new project will look something like this (depending on the settings that you choose):
âââ LICENSE <- Open-source license if one is chosen
âââ Makefile <- Makefile with convenience commands like make data or make train
âââ README.md <- The top-level README for developers using this project.
âââ data
â âââ external <- Data from third party sources.
â âââ interim <- Intermediate data that has been transformed.
â âââ processed <- The final, canonical data sets for modeling.
â âââ raw <- The original, immutable data dump.
â
âââ docs <- A default mkdocs project; see www.mkdocs.org for details
â
âââ models <- Trained and serialized models, model predictions, or model summaries
â
âââ notebooks <- Jupyter notebooks. Naming convention is a number (for ordering),
â the creator's initials, and a short - delimited description, e.g.
â 1.0-jqp-initial-data-exploration.
â
âââ pyproject.toml <- Project configuration file with package metadata for
â {{ cookiecutter.module_name }} and configuration for tools like black
â
âââ references <- Data dictionaries, manuals, and all other explanatory materials.
â
âââ reports <- Generated analysis as HTML, PDF, LaTeX, etc.
â âââ figures <- Generated graphics and figures to be used in reporting
â
âââ requirements.txt <- The requirements file for reproducing the analysis environment, e.g.
â generated with pip freeze > requirements.txt
â
âââ setup.cfg <- Configuration file for flake8
â
âââ {{ cookiecutter.module_name }} <- Source code for use in this project.
â
âââ __init__.py <- Makes {{ cookiecutter.module_name }} a Python module
â
âââ config.py <- Store useful variables and configuration
â
âââ dataset.py <- Scripts to download or generate data
â
âââ features.py <- Code to create features for modeling
â
âââ modeling
â âââ __init__.py
â âââ predict.py <- Code to run model inference with trained models
â âââ train.py <- Code to train models
â
âââ plots.py <- Code to create visualizationsUsing unreleased changes
By default, ccds will use the _project template_ version that corresponds to the _installed ccds package_ version (e.g., if you have installed ccds v2.0.1, you'll use the v2.0.1 version of the project template by default). To use a specific version of the project template, use the -c/--checkout flag to provide the branch (or tag or commit hash) of the version you'd like to use. For example to use the project template from the master branch:
ccds -c masterUsing v1
If you want to use the old v1 project template, you need to have either the cookiecutter-data-science package or cookiecutter package installed. Then, use either command-line program with the -c v1 option:
ccds https://github.com/drivendataorg/cookiecutter-data-science -c v1
or equivalently
cookiecutter https://github.com/drivendataorg/cookiecutter-data-science -c v1Contributing
We welcome contributions! See the docs for guidelines.
Installing development requirements
pip install -r dev-requirements.txtRunning the tests
pytest tests