Cookiecutter is a command-line utility that generates projects from templates. You can use Cookiecutter to create new Python projects and to generate the initial code for different types of applications. In this talk, I will give an introduction to Cookiecutter, how to install it from PyPI, how to use it in the CLI, and finally how to author your own template.
Writing a Python script from scratch is fairly straightforward if you have some experience working in Python. You can usually get by with very little boilerplate code. Starting a new Python project, however, can be tiring if you decide to stick to best practices and plan on submitting it to PyPI later on. It requires great diligence and occasionally gets pretty cumbersome when if you're creating new tools on a regular basis.
So why not use a template for your projects?
Cookiecutter is a command-line utility that creates projects from templates. It is free and open-source software distributed under the terms of a permissive BSD-3 license. With around 150 individual contributors, more than 1000 public templates on GitHub, and multiple talks at conferences, it is fair to say that there is a solid community around it.
In this talk, I will give an introduction on Cookiecutter, how to install it, how to use it in the CLI, and finally how to author your own template. You can use Cookiecutter for all sorts of projects: command-line scripts, Django webapps, and even non-Python projects.
The community has authored and published several templates for Data Science projects, for instance widget-cookiecutter. I will demonstrate how to use Cookiecutter to create a custom Jupyter widget using that template.
The goal of this talk is to teach how to integrate Cookiecutter into your own workflow and share learnings in the form of templates with your team at work and the open source community.