Using toolboxes in Python

QGIS has a processing library. If you go to the Processing menu in QGIS and select Toolbox, you will see a widget displayed with groups of toolboxes. The widget will look as shown:

The processing widget

You have access to the toolboxes in Python by importing processing. You can see the available algorithms by executing the code as follows:

import processingprocessing.alglist()

The previous code imports processing and calls the alglist() method. The results are all of the available algorithms from the installed toolboxes. You should see something similar to the following output:

Advanced Python field calculator--------------------->qgis:advancedpythonfieldcalculator ...

Get Mastering Geospatial Analysis with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.