[Qgis-user] Shared/common library for PyQGIS scripts

Richard Duivenvoorde rdmailings at duif.net
Tue Oct 20 01:59:34 PDT 2020


On 10/20/20 10:48 AM, Jorge Gustavo Rocha wrote:
> Hi,
> 
> I think the PyQGIS Cookbook is the perfect place to share these scripts. The Cookbook is not the API reference documentation. It is the place to share solutions for common problems using the QGIS API.

While I agree with this, note that it currently is not 'simple' to paste some scripts in the cookbook.

Because the cookbook became ... uh a mess, because there were non-running old examples in it, the cookbook is now build in a way that the examples IN the cookbook are actually ran/tested (against/in a Docker QGIS instance). This means that if some api changes, the build of the cookbook of the examples using that api would make the build fail. Which is a good check.

But... it also means that 'just copy pasting' some handy examples is not so easy. You have to make sure that there is data to work with, or make some mockup first to be able an example etc etc...

So: yes, the cookbook is a good place to showoff use of PyQGIS examples (and to show the use of (sometimes not so intuitive) PyQGIS api)... but for practical examples, it takes (for an average PyQGIS user) maybe too much energy?

OR (not sure if that is possible) we should add some 'sketchy' page where indeed people can add working examples and which are not tested... (and which will probably become stale and nobody cares to fix them... like the old cookbook examples)

Not sure what others think about this though...

Regards,

Richard Duivenvoorde


More information about the Qgis-user mailing list