Skip to main content

A collection of helpful tools and widgets to aid QGIS plugin tool development

Project description

QGIS Plugin tools

PyPI version Downloads CI Code on Github Code style: black Imports: isort pre-commit

Warning: The API is not stable yet. Function and files may move between commits.

As it's a submodule, you can configure your GIT to auto update the submodule commit by running:

git config --global submodule.recurse true

The module is helping you with:

  • setting up some logging (QgsMessageLog, file log, remote logs...)
  • fetching resources in resources or other folders
  • fetching compiled UI file in resources/ui folder
  • fetching compiled translation file in resources/i18n folder
  • removing QRC resources file easily
  • translate using the i18n.tr() function.
  • managing the release process : zip, upload on plugins.qgis.org, tag, GitHub release
  • providing some common widgets/code for plugins
  • setting up a debug server

How to install it

For a new plugin

This will create needed structure for your plugin

  1. Create new plugin using cookiecutter-qgis-plugin. This will automatically initialize git and add qgis_plugin_tools as a submodule for the plugin.
  2. Next set up the development environment, edit metadata.txt with description etc. and commit changes.

For existing plugin

  1. Go to the root folder of your plugin code source
  2. git submodule add https://github.com/GispoCoding/qgis_plugin_tools.git
  3. To get most out of the submodule, try to refactor the plugin to use the default plugin tree

As external dependency

This project can also be used as an external dependency. It can be installed via pip:

pip install qgis_plugin_tools

The project can also be installed in editable mode, but you must use setuptool's strict mode because of the submodule nature of the project:

pip install -e /path/to/qgis_plugin_tools --use-pep517 --config-settings editable_mode=strict

Setting up development environment

Refer to development documentation.

How to use it

Refer to usage documentation.

Plugin tree example

The plugin should follow the following file tree to get most out of this module.

Plugin Foo root folder:

  • plugin_repo # no '-' character!
    • .gitmodules
    • .pre-commit-config.yaml
    • .gitattributes
    • .gitignore
    • .qgis-plugin-ci # to use qgis-plugin-ci
    • pluginname # no '-' character!
      • .gitignore
      • qgis_plugins_tools/ # submodule
      • resources/
        • i18n/ # Alternatively translations could use Transifex
          • fi.ts
          • fi.qm
        • ui/
          • main_dialog.ui
        • icons/
          • my_icon.svg
      • __init__.py
      • foo.py
      • metadata.txt
      • build.py
    • test/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qgis_plugin_tools-0.5.0.tar.gz (46.9 kB view details)

Uploaded Source

Built Distribution

qgis_plugin_tools-0.5.0-py3-none-any.whl (52.6 kB view details)

Uploaded Python 3

File details

Details for the file qgis_plugin_tools-0.5.0.tar.gz.

File metadata

  • Download URL: qgis_plugin_tools-0.5.0.tar.gz
  • Upload date:
  • Size: 46.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for qgis_plugin_tools-0.5.0.tar.gz
Algorithm Hash digest
SHA256 bf02c9b4ac1ff9500873d39816722d23e3d946ecb9a22b7e0af8a03033500348
MD5 d503e5a148166a58b3ad5dd1cd1209f2
BLAKE2b-256 bc279959aeb5ac2e37f5e3cc58ee0767be2eb75fb2a5840924561fdff56f7109

See more details on using hashes here.

File details

Details for the file qgis_plugin_tools-0.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for qgis_plugin_tools-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9589623377ab910998747e6a0cbc24e24c2ef60a12a1d3f43363ac031ca27bc4
MD5 bbcec8cc9fd699379ba4c7e4939ccd41
BLAKE2b-256 5202028e00bfa391a34927bfec0e882b9e8d00c1c024c62d000c204ec1d6f55d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page