[QGIS-Developer] Common PyQGIS functions for QGIS 3

Thomas Baumann rdbath.regiodata at gmail.com
Wed Feb 20 00:38:13 PST 2019


Hi qgis-devs,

I recently updated 15 QGIS-plugins to be QGIS3-ready. Most of them were
self written (in house) plugins but four of them were also plugins from the
official repository which were written by someone else.

I noticed that there are severals tasks that have many plugins in common
like:
- load a vectorlayer
- add a layer to the layertree
- iterate through all (visible?) layers of the layertree
- show a message with different levels (info, warning, critical)
- log messages
- reading setting, writing settings
- ...

It seems a bit ineffective that every developer writes these common task
'from scratch'.

There already were some ideas to collect common functions that could be
re-used by plugin-developers:

-some older functions (GIS2) like

https://github.com/NathanW2/parfait

https://github.com/qgis/pyqgis_wrappers

and something newer like

https://github.com/boundlessgeo/lib-qgis-commons
https://pypi.org/project/qgiscommons/


One nice example for utilities collected for a (huge) plugin is:

https://github.com/inasafe/inasafe/tree/master/safe/utilities


Wouldn't it be possible to provide such a collection not only from privat
persons/projects but from the QGIS-project itself so users could add common
functions?
I think the chances would be higher that such a "official" collection would
be used in the long run and constantly extended.

Apart from the fact that developers could save time while writing their
plugins this could perhaps also help to improve the overall quality of the
qgis-plugins as there would probably be several persons who could/would
countercheck these common functions to make sure they are well written.

regards,
Thomas

PS: I asked something similar also on gis.stackexchange recently:

https://gis.stackexchange.com/questions/311755/looking-for-common-pyqgis-functions-for-qgis-3
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20190220/b39d6f9e/attachment-0001.html>


More information about the QGIS-Developer mailing list