A collection of helpful tools and widgets to aid QGIS plugin tool development
Project description
QGIS Plugin tools
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
- Create new plugin using cookiecutter-qgis-plugin. This will automatically initialize git and add qgis_plugin_tools as a submodule for the plugin.
- Next set up the development environment, edit metadata.txt with description etc. and commit changes.
For existing plugin
- Go to the root folder of your plugin code source
git submodule add https://github.com/GispoCoding/qgis_plugin_tools.git
- 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-cipluginname
# no '-' character!.gitignore
qgis_plugins_tools/
# submoduleresources/
i18n/
# Alternatively translations could use Transifexfi.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
Built Distribution
Hashes for qgis_plugin_tools-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f733f93bfa38e16367233c096922ca265d6262c709c36cc01a4c2bf34f25d727 |
|
MD5 | 78ba9ea4b4286cbed3c04fdd4c4975b2 |
|
BLAKE2b-256 | 03b5cf9be51ceea816b5c532df529488ab73208d05ff62d5a54770b5ca1e9e9d |