Member-only story

One Template to Rule Them All: Creating and Managing Python Projects with Cookiecutter and Cruft

Create Projects Fast, Update Them Even Faster

Simone Gigante
7 min readDec 1, 2023
Python logo in the center with many computers around
Image generated with AI by the author

Starting a new Python project can be a daunting task, especially if you want to reuse a structure similar to your previous projects. I prefer to use the same Dockerfile, poetry configuration, folder organization, and so on. Sometimes, of course, there may be some minor variations, but the majority of the code remains the same. Doing this manually every time requires a lot of patience and is time-consuming. Cookiecutter is the perfect solution.

What is Cookiecutter?

Cookiecutter is a Python package that creates projects from templates using Jinja’s syntax. Although it’s a Python package, it can be used to create projects in multiple languages.

Create projects with Cookiecutter

To create a project using Cookiecutter there are two ways: You can install a ready-to-use package, or You can create your custom version. In this article, I will show how to create a custom Cookiecutter version. To get started using Cookiecutter you can install it by running:

poetry add cookiecutter

--

--

Simone Gigante
Simone Gigante

Written by Simone Gigante

Software engineer. I am interested in AI, building applications, games development, VR/AR, data visualization and maths.

Responses (2)