Skip to content

Copy Template

To use the TU Cookbook Python Template without issues, ensure you have the following software installed:

Prerequisets

Install Python via uv

Install uv with the following command:

$ curl -LsSf https://astral.sh/uv/install.sh | sh

Then install Python 3.12 for example using uv:

$ uv python install 3.12

Install Copier

Run one of the following commands to install Copier as a CLI tool:

```console
$ uv tool install copier --with copier-templates-extensions
```
```console
$ pipx install copier
$ pipx inject copier copier-templates-extensions
```

Creating Your Cookbook Repository

Command Line Instructions

To create a new cookbook repository from the TU Cookbooks template, run:

```console
$ copier copy --trust "git+https://gitlab.tuwien.ac.at/cookbooks/templates/tu-cookbook-python" path/to/your/cookbook/
```
If you don't have `copier` installed, you can use `uvx` instead:

```console
$ uvx --with copier-templates-extensions copier copy --trust "git+https://gitlab.tuwien.ac.at/cookbooks/templates/tu-cookbook-python" /path/to/your/cookbook
```

Template Prompts

When you run the copy command, the template will ask you several questions to configure your cookbook. These prompts will look similar to:

$ copier copy --trust "git+https://gitlab.tuwien.ac.at/cookbooks/templates/tu-cookbook-python" path/to/your/cookbook/
The cookbook's name:
    my-cookbook

A short description of the cookbook:
    A cookbook to...

The primary Author's full name:
    John Doe

Choose an appropriate License:
    - MIT
    - Apache License 2.0
    - Unlicense

The template will use your responses to configure the repository structure and initial content.

Next Steps

After creating your repository, you'll need to:

  1. Add your notebooks to the notebooks/ directory
  2. Add any supporting code to the src/ directory
  3. Commit and push your changes to make your cookbook available