Copy Template¶
To use the TU Cookbooks template without issues, ensure you have the following software installed:
- Git v2 - A version control system (Download Git)
- Python 3 - The main Programming Language (Python.org)
- Copier - The Templateing Software (Copier Documentation)
- uv - A modern Python Package Manager (uv Documentation)
- just - A modern Taskrunner (just GitHub)
Install Python via uv¶
Install uv with the following command:
// Install the uv package manager
$ curl -LsSf https://astral.sh/uv/install.sh | sh
Then install Python 3.12 for example using uv:
// install a python version
$ uv python install 3.12
Install Copier¶
Run one of the following commands to install Copier as a CLI tool:
// install the 'copier' tool with dependencies via uv
$ uv tool install copier --with copier-templates-extensions
// install the 'copier' tool with dependencies via pipx
$ 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:
// copy the template
$ 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:
// copy the template without installing 'copier' permanently
$ 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:
// Copy the Template
$ copier copy --trust "git+https://gitlab.tuwien.ac.at/cookbooks/templates/tu-cookbook-python" path/to/your/cookbook/
---> 100%
-> 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 has been installed
$
The template will use your responses to configure the repository structure and initial content.
Next Steps¶
After creating your repository, you'll need to:
- Add your notebooks to the
notebooks/directory - Add any supporting code to the
src/directory - Commit and push your changes to make your cookbook available