CookieCutter features#

  • Cross-platform: Windows, Mac and Linux are supported

  • works with Python 3.6, 3.7, 3.8 and PyPy3

  • The project templates can be created for any programming language and any markup format: Python, JavaScript, Ruby, ReST, CSS, HTML. Several languages can also be used in the same template.

  • Templates can be easily adapted in the terminal:

    $ cookiecutter
    full_name [Veit Schiele]:
  • You can also use local templates:

    $ cookiecutter cookiecutter-namespace-template
  • Alternatively you can also use CookieCutter with Python:

    $ bin/python
    >>> from cookiecutter.main import cookiecutter
    >>> cookiecutter('.')
    full_name [Veit Schiele]:
  • Directory and file names can be assigned to templates, for example:

  • The nesting depth is unlimited

  • The templating is based on Jinja

  • You can simply save your template variables in a cookiecutter.json file, for example:

      "full_name": "Veit Schiele",
      "email": "",
      "github_username": "veit",
      "project_name": "vsc.example",
      "project_slug": "{{ cookiecutter.project_name.lower().replace(' ', '_').replace('-', '_') }}",
      "namespace": "{{ cookiecutter.project_slug.split('.')[0] }}",
      "package_name": "{{ cookiecutter.project_slug.split('.')[1] }}",
      "project_short_description": "Python Namespace Package contains all you need to create a Python namespace package.",
      "pypi_username": "veit",
      "use_pytest": "y",
      "command_line_interface": ["Click", "No command-line interface"],
      "version": "0.1.0",
      "create_author_file": "y",
      "license": ["MIT license", "BSD license", "ISC license", "Apache Software License 2.0", "GNU General Public License v3", "Not open source"]
  • You can also save the values for several templates in ~/cookiecutterrc:

        full_name: "Veit Schiele"
        email: ""
        github_username: "veit"
    cookiecutters_dir: "~/.cookiecutters/"
  • CookieCutter templates loaded from a repository are usually stored in ~/.cookiecutters/. Then they can be referenced directly via their directory name, e.g. with:

    $ cookiecutter cookiecutter-namespace-package