NINA Python template

A template to fast setup python projects

Requirements

How to use it

Make sure that copier is installed, then run:

copier copy --trust gh:ninanor/python-template my-awesome-python-project

Answer the questions and you are done.

Features

Why should I use this template:

  • Auto formatting and code checking using ruff
  • optional Docker image
  • Updatable template
  • Visual Studio configurations
  • Git automatic setup
  • Django optional template

I want the simpliest of the templates

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!

How to update

Basically you just need to run:

copier update --trust

You can now change your questions, in case you want to keep your previous answers use: copier update --trust --defaults.

This will try to check differences between your project and the template, if no conflicts are found you are done. Check this page for more specific info about this feature.

Move the generated project

If you wish to move the project generated by the template in your filesystem, you need to:

  • delete .venv (if it is present)
  • create a new venv python3 -m venv .venv
  • install again the dependencies source .venv/bin/activate && pip install -e .[tools]

Available profiles

  • python
    • docker; add standard files for dockerizing a python project
  • django (web application development with docker and PostgreSQL)
    • gis; add support for GIS to django
    • ldap; allow users to login with NINA credentials (only for internal projects)
    • rest; creates a skelton for REST APIs
    • ui; add some ready to use code for serving UI code directly from Django

Struggling with a template?

Please report any issues you have using the template, even if some documentation is unclear or is missing!