Class: QgsProcessingProvider¶
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.
Note
This is an abstract class, with methods which must be implemented by a subclass.
The following methods must be implemented: id()
, loadAlgorithms()
, name()
Class Hierarchy¶
Base classes¶
Subclasses¶
QGIS 3D processing algorithm provider. |
|
Native c++ processing algorithm provider. |
Enums
alias of |
Abstract Methods
Returns the unique provider id, used for identifying the provider. |
|
Loads all algorithms belonging to this provider. |
|
Returns the provider name, which is used to describe the provider within the GUI. |
Methods
Adds an algorithm to the provider. |
|
Returns the matching algorithm by name, or |
|
Returns a list of algorithms supplied by this provider. |
|
Refreshes the algorithms available from the provider, causing it to re-populate with all associated algorithms. |
Virtual Methods
In PyQGIS, only methods marked as virtual
can be safely overridden in a Python subclass of QgsProcessingProvider. See the FAQ for more details.
Returns |
|
Returns the default file extension to use for point cloud outputs created by the provider. |
|
Returns the default file extension to use for raster outputs created by the provider. |
|
Returns the default file extension to use for vector outputs created by the provider. |
|
Returns the default file extension to use for vector tile outputs created by the provider. |
|
Returns the flags indicating how and when the provider operates and should be exposed to users. |
|
Returns the provider help id string, used for creating |
|
Returns an icon for the provider. |
|
Returns |
|
Returns |
|
Loads the provider. |
|
Returns the longer version of the provider name, which can include extra details such as version numbers. |
|
Returns a list of the point cloud format file extensions supported by this provider. |
|
Returns a list of the raster format file extensions supported by this provider. |
|
Returns a list of the table (geometry-less vector layers) file extensions supported by this provider. |
|
Returns a list of the vector format file extensions supported by this provider. |
|
Returns a list of the vector tile format file extensions supported by this provider. |
|
Returns |
|
Returns a path to an SVG version of the provider's icon. |
|
Unloads the provider. |
|
Returns a version information string for the provider, or an empty string if this is not applicable (e.g. for inbuilt Processing providers). |
|
Returns an optional warning message to show users when running algorithms from this provider. |
Signals
Emitted when the provider has loaded (or refreshed) its list of available algorithms. |
- class qgis.core.QgsProcessingProvider[source]¶
Bases:
QObject
- __init__(parent: QObject | None = None)
Constructor for QgsProcessingProvider.
- Parameters:
parent (Optional[QObject] = None)
- Flag¶
alias of
ProcessingProviderFlag
- Flags¶
alias of
ProcessingProviderFlags
- addAlgorithm(self, algorithm: QgsProcessingAlgorithm | None) bool [source]¶
Adds an
algorithm
to the provider. Ownership of the algorithm is transferred to the provider.- Parameters:
algorithm (Optional[QgsProcessingAlgorithm])
- Return type:
bool
- algorithm(self, name: str | None) QgsProcessingAlgorithm | None [source]¶
Returns the matching algorithm by
name
, orNone
if no matching algorithm is contained by this provider.See also
- Parameters:
name (Optional[str])
- Return type:
Optional[QgsProcessingAlgorithm]
- algorithms(self) List[QgsProcessingAlgorithm] ¶
Returns a list of algorithms supplied by this provider.
See also
- Return type:
List[QgsProcessingAlgorithm]
- signal algorithmsLoaded[source]¶
Emitted when the provider has loaded (or refreshed) its list of available algorithms.
See also
- virtual canBeActivated(self) bool [source]¶
Returns
True
if the provider can be activated, orFalse
if it cannot be activated (e.g. due to missing external dependencies).See also
- Return type:
bool
- virtual defaultPointCloudFileExtension(self) str [source]¶
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.See also
See also
See also
Added in version 3.24.
- Return type:
str
- virtual defaultRasterFileExtension(self) str [source]¶
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.See also
See also
See also
- Return type:
str
- virtual defaultVectorFileExtension(self, hasGeometry: bool = True) str [source]¶
Returns the default file extension to use for vector outputs created by the provider.
If
hasGeometry
isTrue
then the output file format must have support for geometry. IfhasGeometry
isFalse
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.See also
See also
See also
- Parameters:
hasGeometry (bool = True)
- Return type:
str
- virtual defaultVectorTileFileExtension(self) str [source]¶
Returns the default file extension to use for vector tile outputs created by the provider.
The default implementation returns the user’s default Processing vector tile output format setting, if it’s supported by the provider (see
supportedOutputVectorTileLayerExtensions()
). Otherwise the first reported supported vector tile format will be used.See also
See also
Added in version 3.32.
- Return type:
str
- virtual flags(self) Qgis.ProcessingProviderFlags [source]¶
Returns the flags indicating how and when the provider operates and should be exposed to users. Default is no flags.
Added in version 3.14.
- Return type:
- virtual helpId(self) str [source]¶
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 noQgsHelp
url should be created for the provider’s algorithms.See also
- Return type:
str
- abstract id(self) str [source]¶
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
See also
- Return type:
str
- virtual isActive(self) bool [source]¶
Returns
True
if the provider is active and able to run algorithms.- Return type:
bool
- virtual isSupportedOutputValue(self, outputValue: Any, parameter: QgsProcessingDestinationParameter | None, context: QgsProcessingContext)[source]¶
Returns
True
if the specifiedoutputValue
is of a supported file format for the given destinationparameter
.If the output value is not supported,
error
will be set to a descriptive message explaining why.Added in version 3.6.
- Parameters:
outputValue (Any)
parameter (Optional[QgsProcessingDestinationParameter])
context (
QgsProcessingContext
) -> (bool)
- virtual load(self) bool [source]¶
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 theloadAlgorithms()
method. Instead, subclasses should callrefreshAlgorithms()
from any overloadedload()
method to trigger an initial load of the provider’s algorithms.- Return type:
bool
- Returns:
True
if provider could be successfully loaded
See also
- abstract loadAlgorithms(self)[source]¶
Loads all algorithms belonging to this provider. Subclasses should implement this, calling
addAlgorithm()
to register all their associated algorithms.
- virtual longName(self) str [source]¶
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
See also
- Return type:
str
- abstract name(self) str [source]¶
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
See also
- Return type:
str
- refreshAlgorithms(self)[source]¶
Refreshes the algorithms available from the provider, causing it to re-populate with all associated algorithms.
- virtual supportedOutputPointCloudLayerExtensions(self) List[str] [source]¶
Returns a list of the point cloud format file extensions supported by this provider.
See also
See also
See also
Added in version 3.24.
- Return type:
List[str]
- virtual supportedOutputRasterLayerExtensions(self) List[str] [source]¶
Returns a list of the raster format file extensions supported by this provider.
- Return type:
List[str]
- virtual supportedOutputTableExtensions(self) List[str] [source]¶
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.See also
See also
Added in version 3.4.3.
- Return type:
List[str]
- virtual supportedOutputVectorLayerExtensions(self) List[str] [source]¶
Returns a list of the vector format file extensions supported by this provider.
See also
See also
See also
- Return type:
List[str]
- virtual supportedOutputVectorTileLayerExtensions(self) List[str] [source]¶
Returns a list of the vector tile format file extensions supported by this provider.
By default returns a list containing only “mbtiles” extension.
See also
See also
See also
Added in version 3.32.
- Return type:
List[str]
- virtual supportsNonFileBasedOutput(self) bool [source]¶
Returns
True
if the provider supports non-file based outputs (such as memory layers or direct database outputs). If a provider returnsFalse
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. ReturningTrue
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
- virtual svgIconPath(self) str [source]¶
Returns a path to an SVG version of the provider’s icon.
See also
- Return type:
str
- virtual unload(self)[source]¶
Unloads the provider. Any tear-down steps required by the provider should be implemented here.
See also
- virtual versionInfo(self) str [source]¶
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.
Added in version 3.8.
- Return type:
str
- virtual warningMessage(self) str [source]¶
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.
Added in version 3.10.1.
- Return type:
str