🚀 Skip the boring setup and jump straight into coding! This template gives you everything you need for a modern Python project - from code formatting to CI/CD - all configured and ready to go.
Make sure that uv is installed, then run (replace your-project-name with your desired project name):
uvx --with copier_template_extensions copier copy --trust gh:ninanor/template-python your-project-nameAnswer the questions and you are done.
To apply this template to an existing project directory:
cd your-existing-project
uvx --with copier_template_extensions copier copy --trust gh:ninanor/template-python .This will add the template files to your current directory. Be careful as this may overwrite existing files.
Why should I use this template:
- Auto formatting and code checking using
ruff - Updatable template - Easy to keep up to date with latest practices
- Visual Studio Code configurations included
- Git hooks with prek for code quality enforcement
- GitHub Actions workflows for CI/CD
When creating a project, you can choose from these additional features:
- Docker - Add standard files for dockerizing a Python project
- Type annotations - Make type annotations mandatory throughout the project
- Notebook support - Include Jupyter or Marimo notebook support
Press Enter to all questions, you'll get a simple Python project to start with.
Keep in mind that you can always change your answers, it's fine if you want to start with something simple and then for example you need Docker. Update the template, change your answers in the survey and you will get the code for that!
You just need to run:
uvx --with copier_template_extensions copier update --trust --defaults
In case you want to change your answers you can drop the --defaults flag:
uvx --with copier_template_extensions copier update --trust
In both cases, copier will try to check differences between your project and the template. It might be necessary to fix some conflicts: in this case it is up to the user to decide whenever to include or reject the improvements of the template into the repository.
Check this page for more specific info about this feature.
prek is a fast, Rust-based framework for managing git hooks. It's 100% compatible with pre-commit configs but significantly faster. Git hooks help identify issues in your code before pushing to the repository, such as missing semicolons, trailing whitespace, or unused dependencies.
✨ prek doesn't change the functionality of your code
To run prek on your code, first install prek:
uv tool install prek
Then install the git hooks:
prek install
To run manually on all files:
prek run --all-files
Please report any issues you have using the template, even if some documentation is unclear or is missing!
Install development dependencies:
- pinact:
./scripts/install-pinact.sh
To test the template using copier-template-tester, run:
prek run -c prek-extra.tomlTo update dependencies and tools:
./scripts/maintenance.shTo create a new release:
./scripts/release.sh <patch|minor|major>Example:
./scripts/release.sh minor