🚀 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/python-template your-project-name
Answer 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/python-template .
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
- Pre-commit hooks 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_extension 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.
pre-commit is a framework for managing pre-commit git hooks. The pre-commit git hooks are ways to identify issues in your code before pushing your changes to the repository, for instance missing semicolons, trailing whitespace, unused dependencies.
✨ pre-commit doesn't change the functionality of your code
To run pre-commit on your code, first install pre-commit:
uv tool install pre-commit
Then run:
pre-commit run --all
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:
pre-commit run -c .pre-commit-config-extra.yaml
To update dependencies and tools:
./scripts/maintenance.sh
To create a new release:
./scripts/release.sh <patch|minor|major>
Example:
./scripts/release.sh minor