QGIS Plugin templater - Documentation

Description : Template for developing QGIS plugins using modern and relatively accepted ‘good’ practices about tooling, code structuration, documentation and tests.
Author and contributors: Julien Moura
Version: 3.16.1
Source code: https://gitlab.com/Oslandia/qgis/template-qgis-plugin/
Last documentation build: 04 November 2021

Code style: black Imports: isort pre-commit

Repository template for developing QGIS plugins using modern and accepted “good” practices about tooling, code structuration, documentation and tests.

It’s based on the amazing project templating engine: Cookiecutter.

Cookiecutter logo

Requirements

  • Python 3.7+

  • Recomended: Git

In a nutshell

# install cookiecutter
python -m pip install "cookiecutter>=1.7.0"
# run cookiecutter with this repository
cookiecutter https://gitlab.com/Oslandia/qgis/template-qgis-plugin
# if you don't have installed Git, use the ZIP URL
cookiecutter https://gitlab.com/Oslandia/qgis/template-qgis-plugin/-/archive/master/template-qgis-plugin-master.zip

You’ll be prompted for some values. Provide them, then a QGIS plugin project folder will be created for you.

It’s also possible to override the prompt:

cookiecutter --no-input -f https://gitlab.com/Oslandia/qgis/template-qgis-plugin plugin_name=my_latest_plugin

In this case, the output folder is: plugin_my_latest_plugin.

A quick view (click on image to open it wider):

QGIS plugin templater demo gif