Skip to content

Latest commit

 

History

History
 
 

template

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Template

We can use Cookiecutter, to initialise a project using a template with the same structure seen in the tutorial.

We start by creating a repository on GitHub without initialising a readme file. In the following, <project_name> refers to the GitHub repository name.

Install Coockiecutter if you do not have it already.

pip install cookiecutter

Clone this repository to the system temporary folder, $TMPDIR.

git clone [email protected]:Satalia/production-data-science.git $TMPDIR/production_data_science_template

Go to the folder where you would like to store the project and create the project template.

cd <folder_to_store_project>
cookiecutter $TMPDIR/production_data_science_template/template

You will be prompted with values to fill, like the project name (use <project_name>), the package name and the author name.

Create a virtual environment and install the package.

cd <project_name>
mkvirtualenv <project_name>
pip install -e .
pip freeze | grep -v <package_name> > requirements.txt
git init
git add .
git commit -m "First commit"
git remote add origin <remote_repository_url>.git
git push -u origin master

Here, <package_name> is the name of the Python package to be used to productionise the exploratory work, and should match the respective value you imputed in Cookiecutter.

Moreover, if you are planning to use the Jupyter Notebook, you have to install the kernel of the environment.

python -m ipykernel install --user --name <project_name>

Now, create a branch, switch to it,

git checkout -b <branch_name>

and you are ready! 🎉