This repository is a Cookie Cutter template for spinning up a data science project in which you'd also like to quickly develop and refactor Python code into a separate package.
This template uses poetry to install dependencies, and will install the package that's being created in editable mode into the current virtual environment.
This template:
- creates a
datafolder - creates a
notebooksfolder - creates a Python package folder with name you passed on the command line
- creates
scriptsfolder for global scripts to be run - creates a
testsfolder to test your package - creates a
pyproject.tomlfile with common dev dependencies, default tool configurations and Python package configurations - creates a
.git-devfolder:hooks/prepare-commit-msg- a git hook that appends your ticket number (pulled from your active branch name) and inserts it at the end of your commit message.gitmessage- a default template for your commit messagesconfig- additional project-specific configurations for git that get appended to your.git/configfile- configure
gitto use VSCode as the commit message editor - configure
gitto use thegitmessagetemplate inside.git/.gitmessageas the default commit message template
- configure
- creates a
.vscode-devfolder:- it gets renamed to
.vscodeduring installation so it's used by your VSCode IDE - it contains
settings.jsonwith:- a configuration to use
pyteston thetestsdirectory in the root of the repo - your current active poetry Python interpreter gets injected into the
settings.jsonfile at installation time mypyvalidation is enabled by default
- a configuration to use
- it gets renamed to
- creates a
.gitignorefile with a lot of default ignorable file patterns - creates a
Makefilewith some helper PHONY targets
This is a cookie cutter template. So the steps to using this repo are to:
- clone this repo
- edit the
cookiecutter.jsonfile to reflect your project's details - run
cookiecutter <path-to-this-repo>from wherever you'd like to create your new project folder
You can also run cookiecutter directly from GitHub with this template by running one of:
cookiecutter https://github.com/jcorrado76/data-science-cookie-cutter-with-package.git
cookiecutter git+ssh://git@github.com:jcorrado76/data-science-cookie-cutter-with-package.git
cookiecutter gh:jcorrado76/data-science-cookie-cutter-with-packageRead more about using cookiecutter from here.
You can find the command line options here.
After running these commands, you should have your project folder, by the name of {{ cookiecutter.project_name }}.
Inside that project folder, you'll have the above named resources, plus a folder with the value of {{ cookiecutter.package_name }} that you supplied.
The idea is that we have tests in the root of the project, so it's easy for developers to run testing from the root of the repo.
This facilitates:
- not including tests in your deployed package
- installing your python package locally in editable mode, so you can use it easier