Using and Mastering Cookiecutter Transcripts
Chapter: Creating Cookiecutter templates
Lecture: The meta template

Login or purchase this course to watch this video and the rest of the course contents.
0:01 Now you know how to create these Cookiecutter templates and I feel like I've shown you something of the hard way.
0:07 And I did that on purpose, not to torture you but because I want you to really see and understand all the moving parts,
0:13 but, if I was going to go create a new Cookiecutter template, there is a very good chance I would use a Cookiecutter template to do that.
0:20 That's kind of circular, isn't it, but there is a template called cookiecutter-template, and its goal is to ask you the questions to generate
0:29 the basic project structure for creating a Cookiecutter template. So you can get it from this URL here, let's go and run it.
0:36 Alright, my name is Michael Kennedy, remember that comes from my default file, similarly my email, my GitHub user name all these things,
0:43 the name of the project, let's suppose we want to do something with race cars simulations, so I'll call this Race Sim,
0:50 something like that, and notice, it uses that dependent thing to generate the right naming structure, it's going to put cookiecutter-
1:02 which is the convention for naming these templates, it's not required but it's the convention, and it slugifies, if you will,
1:09 it creates the lower case no spaces version of the name, so perfect, let's just go with that, short description,
1:17 this will be the starter template for creating race car simulations. Okay, again, today is the day we are going to do it; yes, we want to copy hooks.
1:34 Boom it's done, okay, let's see what we got, it should be in cookiecutter-race-sim and there it is so let's open it up, alright, now in here,
1:42 notice, we've got a Cookiecutter template, it has a cookiecutter.json and it has a directory that has got a name in there and it's going to have
1:52 basically the project slug name put there when you run it, it also has a CHANGELOG,
1:56 it has hooks, a post generation hook with some code already built for us, so we can use that to start, no pre gen hook but that's okay,
2:06 it has a license, a README and so on. This is really nice and if you're going to get started, just make sure, you don't want to make any mistakes,
2:14 so might as well just say cookiecutter cookiecutter-template And get started that way.


Talk Python's Mastodon Michael Kennedy's Mastodon