Session Ready
Exercise

Set up template

For our first project template exercise, we will write a cookiecutter.json file that will contain defaults for our project template.

Our cookiecutter.json file will contain three keys:

  • project
  • package
  • license

The package key's value is a Jinja2 template string that will use the project key's value to create a snake_case package name by converting the input string to lowercase and replacing spaces with underscores.

Inside the double curly braces ({{}}) of the Jinja2 template string, we can use any Python code necessary to create the desired final value.

The license key's value is a list of possible license types:

  • MIT
  • BSD
  • GPL3
Instructions
100 XP
  • Create the package name by converting the project name into snake_case (lowercase with underscores instead of spaces).
  • Fill in the default license value.