talira

Cookiecutter

Create projects from project templates

open sourceBSD-3-Clauseself-hostablefree

Cookiecutter is a cross-platform command-line tool that creates a new project from a project template, called a cookiecutter. A template is a directory whose file names and contents contain variables; a cookiecutter.json file declares each variable and its default, Cookiecutter prompts for the values and renders the files with Jinja. Templates work for any language or format, can come from a local folder, a Git repository (gh:owner/repo) or a zip file, and can run pre-prompt and pre- and post-generate hooks in Python or shell for steps such as git init or installing dependencies. It's also a Python library, so other tools can generate projects with cookiecutter(). Thousands of community templates exist on GitHub for Python packages, Django sites, data science projects and more.

Problems it solves

  • every new Python package I start means copying the same boilerplate files by hand
  • make our team's new services all start from the same project skeleton
  • fill in the project name and author across a dozen template files automatically
  • start a Django or data science project from a well-known template
  • run git init and install dependencies right after generating a new project
  • share a project template on GitHub that others can generate from with one command
  • generate projects from a template inside my own Python tool

Features

  • templates from local folders, Git repositories and zip files
  • cookiecutter.json variables with defaults and prompts
  • Jinja templating in file names and contents
  • pre-prompt, pre-generate and post-generate hooks in Python or shell
  • Python API
  • templates in any language or format
  • Windows, macOS and Linux

Capabilities

Has a command line toolplan not known
Has official SDKsplan not known

Alternatives

The same job

These do what Cookiecutter does.

  1. Yeoman The web's scaffolding tool: run generators to start new projects with yo

Compare Cookiecutter with the top 3