Class: QgsProcessingProvider

class qgis.core.QgsProcessingProvider

Bases: PyQt5.QtCore.QObject

Abstract base class for processing providers.

An algorithm provider is a set of related algorithms, typically from the same external application or related to a common area of analysis.

New in version 3.0.

QgsProcessingProvider(parent: QObject = None) Constructor for QgsProcessingProvider.

Methods

addAlgorithm

Adds an algorithm to the provider.

algorithm

Returns the matching algorithm by name, or None if no matching algorithm is contained by this provider.

algorithms

Returns a list of algorithms supplied by this provider.

canBeActivated

Returns True if the provider can be activated, or False if it cannot be activated (e.g. due to missing external dependencies).

childEvent

connectNotify

customEvent

defaultPointCloudFileExtension

Returns the default file extension to use for point cloud outputs created by the provider.

defaultRasterFileExtension

Returns the default file extension to use for raster outputs created by the provider.

defaultVectorFileExtension

Returns the default file extension to use for vector outputs created by the provider.

disconnectNotify

flags

Returns the flags indicating how and when the provider operates and should be exposed to users.

helpId

Returns the provider help id string, used for creating QgsHelp urls for algorithms belong to this provider.

icon

Returns an icon for the provider.

id

Returns the unique provider id, used for identifying the provider.

isActive

Returns True if the provider is active and able to run algorithms.

isSignalConnected

isSupportedOutputValue

Returns True if the specified outputValue is of a supported file format for the given destination parameter.

load

Loads the provider.

loadAlgorithms

Loads all algorithms belonging to this provider.

longName

Returns the longer version of the provider name, which can include extra details such as version numbers.

name

Returns the provider name, which is used to describe the provider within the GUI.

receivers

refreshAlgorithms

Refreshes the algorithms available from the provider, causing it to re-populate with all associated algorithms.

sender

senderSignalIndex

supportedOutputPointCloudLayerExtensions

Returns a list of the point cloud format file extensions supported by this provider.

supportedOutputRasterLayerExtensions

Returns a list of the raster format file extensions supported by this provider.

supportedOutputTableExtensions

Returns a list of the table (geometry-less vector layers) file extensions supported by this provider.

supportedOutputVectorLayerExtensions

Returns a list of the vector format file extensions supported by this provider.

supportsNonFileBasedOutput

Returns True if the provider supports non-file based outputs (such as memory layers or direct database outputs).

svgIconPath

Returns a path to an SVG version of the provider's icon.

timerEvent

unload

Unloads the provider.

versionInfo

Returns a version information string for the provider, or an empty string if this is not applicable (e.g. for inbuilt Processing providers).

warningMessage

Returns an optional warning message to show users when running algorithms from this provider.

Signals

algorithmsLoaded

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

Attributes

FlagDeemphasiseSearchResults

class Flag

Bases: int

FlagDeemphasiseSearchResults = 2
class Flags
class Flags(Union[QgsProcessingProvider.Flags, QgsProcessingProvider.Flag])
class Flags(QgsProcessingProvider.Flags)

Bases: sip.wrapper

addAlgorithm(self, algorithm: QgsProcessingAlgorithm) bool

Adds an algorithm to the provider. Ownership of the algorithm is transferred to the provider.

Parameters:

algorithm (QgsProcessingAlgorithm) –

Return type:

bool

algorithm(self, name: str) QgsProcessingAlgorithm

Returns the matching algorithm by name, or None if no matching algorithm is contained by this provider.

See also

algorithms()

Parameters:

name (str) –

Return type:

QgsProcessingAlgorithm

algorithms(self) List[QgsProcessingAlgorithm]

Returns a list of algorithms supplied by this provider.

See also

algorithm()

Return type:

List[QgsProcessingAlgorithm]

algorithmsLoaded

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

canBeActivated(self) bool

Returns True if the provider can be activated, or False if it cannot be activated (e.g. due to missing external dependencies).

See also

isActive()

Return type:

bool

childEvent(self, QChildEvent)
connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
defaultPointCloudFileExtension(self) str

Returns the default file extension to use for point cloud outputs created by the provider.

The default implementation returns the user’s default Processing point cloud output format setting, if it’s supported by the provider (see supportedOutputPointCloudLayerExtensions()). Otherwise the first reported supported point cloud format will be used.

New in version 3.24.

Return type:

str

defaultRasterFileExtension(self) str

Returns the default file extension to use for raster outputs created by the provider.

The default implementation returns the user’s default Processing raster output format setting, if it’s supported by the provider (see supportedOutputRasterLayerExtensions()). Otherwise the first reported supported raster format will be used.

Return type:

str

defaultVectorFileExtension(self, hasGeometry: bool = True) str

Returns the default file extension to use for vector outputs created by the provider.

If hasGeometry is True then the output file format must have support for geometry. If hasGeometry is False then non-spatial formats can be used.

The default implementation returns the user’s default Processing vector output format setting, if it’s supported by the provider (see supportedOutputVectorLayerExtensions()). Otherwise the first reported supported vector format will be used.

Parameters:

hasGeometry (bool = True) –

Return type:

str

disconnectNotify(self, QMetaMethod)
flags(self) QgsProcessingProvider.Flags

Returns the flags indicating how and when the provider operates and should be exposed to users. Default is no flags.

New in version 3.14.

Return type:

QgsProcessingProvider.Flags

helpId(self) str

Returns the provider help id string, used for creating QgsHelp urls for algorithms belong to this provider. By default, this returns an empty string, meaning that no QgsHelp url should be created for the provider’s algorithms.

See also

id()

Return type:

str

icon(self) QIcon

Returns an icon for the provider.

See also

svgIconPath()

Return type:

QIcon

id(self) str

Returns the unique provider id, used for identifying the provider. This string should be a unique, short, character only string, eg “qgis” or “gdal”. This string should not be localised.

See also

name()

See also

helpId()

Return type:

str

isActive(self) bool

Returns True if the provider is active and able to run algorithms.

Return type:

bool

isSignalConnected(self, QMetaMethod) bool
isSupportedOutputValue(self, outputValue: Any, parameter: QgsProcessingDestinationParameter, context: QgsProcessingContext) Tuple[bool, str]

Returns True if the specified outputValue is of a supported file format for the given destination parameter.

If the output value is not supported, error will be set to a descriptive message explaining why.

New in version 3.6.

Parameters:
Return type:

Tuple[bool, str]

load(self) bool

Loads the provider. This will be called when the plugin is being loaded, and any general setup actions should occur in an overridden version of this method. Subclasses should not individually load any algorithms in their load() implementations, as that must occur within the loadAlgorithms() method. Instead, subclasses should call refreshAlgorithms() from any overloaded load() method to trigger an initial load of the provider’s algorithms.

Return type:

bool

Returns:

True if provider could be successfully loaded

See also

unload()

loadAlgorithms(self)

Loads all algorithms belonging to this provider. Subclasses should implement this, calling addAlgorithm() to register all their associated algorithms.

longName(self) str

Returns the longer version of the provider name, which can include extra details such as version numbers. E.g. “Lastools LIDAR tools (version 2.2.1)”. This string should be localised.

The default implementation returns the same string as name().

See also

name()

See also

id()

Return type:

str

name(self) str

Returns the provider name, which is used to describe the provider within the GUI. This string should be short (e.g. “Lastools”) and localised.

See also

longName()

See also

id()

Return type:

str

receivers(self, PYQT_SIGNAL) int
refreshAlgorithms(self)

Refreshes the algorithms available from the provider, causing it to re-populate with all associated algorithms.

sender(self) QObject
senderSignalIndex(self) int
supportedOutputPointCloudLayerExtensions(self) List[str]

Returns a list of the point cloud format file extensions supported by this provider.

New in version 3.24.

Return type:

List[str]

supportedOutputRasterLayerExtensions(self) List[str]

Returns a list of the raster format file extensions supported by this provider.

Return type:

List[str]

supportedOutputTableExtensions(self) List[str]

Returns a list of the table (geometry-less vector layers) file extensions supported by this provider.

By default this is the same as supportedOutputVectorLayerExtensions(). Providers which utilize different formats for geometry-less layers can override this method to return a different list of supported formats.

New in version 3.4.3.

Return type:

List[str]

supportedOutputVectorLayerExtensions(self) List[str]

Returns a list of the vector format file extensions supported by this provider.

Return type:

List[str]

supportsNonFileBasedOutput(self) bool

Returns True if the provider supports non-file based outputs (such as memory layers or direct database outputs). If a provider returns False for this method than it indicates that none of the outputs from any of the provider’s algorithms have support for non-file based outputs. Returning True indicates that the algorithm’s parameters will each individually declare their non-file based support.

The default behavior for providers is to support non-file based outputs, and most providers which rely solely on QGIS API (and which do not depend on third-party scripts or external dependencies) will automatically support this.

Return type:

bool

svgIconPath(self) str

Returns a path to an SVG version of the provider’s icon.

See also

icon()

Return type:

str

timerEvent(self, QTimerEvent)
unload(self)

Unloads the provider. Any tear-down steps required by the provider should be implemented here.

See also

load()

versionInfo(self) str

Returns a version information string for the provider, or an empty string if this is not applicable (e.g. for inbuilt Processing providers).

For plugin based providers, this should return the plugin’s version identifier.

New in version 3.8.

Return type:

str

warningMessage(self) str

Returns an optional warning message to show users when running algorithms from this provider.

This can be used to return a translated warning message which should be shown to users of this provider. It’s intended for use in cases such as a provider which relies on a 3rd-party backend, where the version of the backend software is not officially supported, or for alerting users to providers in a “beta” or “untrustworthy” state.

New in version 3.10.1.

Return type:

str