I was trying to access processing algorithm using PyQGIS 3 on a standalone script. I found this solution and tried it but when I list the processing algorithm using print(QgsApplication.processingRegistry().algorithms()) it only lists the built-in plugins. The contour plugin that I wanted to import is not listed although it works just fine QGIS.
I have tried this code in QGIS Console:
import processing
QgsApplication.processingRegistry().algorithms()
and the contour plugin is listed there as <contour.ContourGeneratorAlgorithm.ContourGeneratorAlgorithm object at 0x7fe052e6aca8>, but when I tried in standalone script using this script:
sys.path.append('/usr/share/qgis/python/plugins/processing')
import processing
from processing.core.Processing import Processing
Processing.initialize()
print(QgsApplication.processingRegistry().algorithms())
it only lists the built-in plugins. Where is my mistake?
Btw, Contour plugin is an external QGIS plugin that make a contour from data points as an input. This plugin still in experimental state.
/home/user/.local/share/QGIS/QGIS3/profiles/default/python/plugins, then i have to import it first usingfrom contour.ContourGeneratorProvider import ContourGeneratorProviderthen add it to the processing registry using your code. And then I have to import the processing module. This last step will imports all the processing algorithms, which i think a bit too excessive. But I have to do that though in order to run the contour plugin algorithm. – Ayato Jun 27 '18 at 08:25