Class: QgsProcessingRegistry

Registry for various processing components, including providers, algorithms and various parameters and outputs.

QgsProcessingRegistry is not usually directly created, but rather accessed through QgsApplication.processingRegistry().

Class Hierarchy

Inheritance diagram of qgis.core.QgsProcessingRegistry

Base classes

QObject

Methods

addAlgorithmAlias

Adds a new alias to an existing algorithm.

addParameterType

Register a new parameter type for processing.

addProvider

Add a processing provider to the registry.

algorithmById

Finds an algorithm by its ID.

algorithmInformation

Returns basic algorithm information for the algorithm with matching ID.

algorithms

Returns a list of all available algorithms from registered providers.

createAlgorithmById

Creates a new instance of an algorithm by its ID.

parameterType

Returns the parameter type registered for id.

parameterTypes

Returns a list with all known parameter types.

providerById

Returns a matching provider by provider ID.

providers

Gets list of available providers.

removeParameterType

Unregister a custom parameter type from processing.

removeProvider

Removes a provider implementation from the registry (the provider object is deleted).

Signals

parameterTypeAdded

Emitted when a new parameter type has been added to the registry.

parameterTypeRemoved

Emitted when a parameter type has been removed from the registry and is about to be deleted.

providerAdded

Emitted when a provider has been added to the registry.

providerRemoved

Emitted when a provider is removed from the registry

class qgis.core.QgsProcessingRegistry[source]

Bases: QObject

__init__(parent: QObject | None = None)

Constructor for QgsProcessingRegistry.

Parameters:

parent (Optional[QObject] = None)

addAlgorithmAlias(self, aliasId: str | None, actualId: str | None)[source]

Adds a new alias to an existing algorithm.

This allows algorithms to be referred to by a different provider ID and algorithm name to their actual underlying provider and algorithm name. It provides a mechanism to allow algorithms to be moved between providers without breaking existing scripts or plugins.

The aliasId argument specifies the “fake” algorithm id (eg “fake_provider:fake_alg”) by which the algorithm can be referred to, and the actualId argument specifies the real algorithm ID for the algorithm.

Added in version 3.10.

Parameters:
  • aliasId (Optional[str])

  • actualId (Optional[str])

addParameterType(self, type: QgsProcessingParameterType | None) bool[source]

Register a new parameter type for processing. Ownership is transferred to the registry. Will emit parameterTypeAdded.

Added in version 3.2.

Parameters:

type (Optional[QgsProcessingParameterType])

Return type:

bool

addProvider(self, provider: QgsProcessingProvider | None) bool[source]

Add a processing provider to the registry. Ownership of the provider is transferred to the registry, and the provider’s parent will be set to the registry. Returns False if the provider could not be added (eg if a provider with a duplicate ID already exists in the registry). Adding a provider to the registry automatically triggers the providers QgsProcessingProvider.load() method to populate the provider with algorithms.

See also

removeProvider()

Parameters:

provider (Optional[QgsProcessingProvider])

Return type:

bool

algorithmById(self, id: str | None) QgsProcessingAlgorithm | None[source]

Finds an algorithm by its ID. If no matching algorithm is found, None is returned.

See also

algorithms()

Parameters:

id (Optional[str])

Return type:

Optional[QgsProcessingAlgorithm]

algorithmInformation(self, id: str | None) QgsProcessingAlgorithmInformation[source]

Returns basic algorithm information for the algorithm with matching ID.

This method uses an internal cache to ensure that information is quickly returned and is suitable for calling many times.

Added in version 3.32.

Parameters:

id (Optional[str])

Return type:

QgsProcessingAlgorithmInformation

algorithms(self) List[QgsProcessingAlgorithm]

Returns a list of all available algorithms from registered providers.

See also

algorithmById()

Return type:

List[QgsProcessingAlgorithm]

createAlgorithmById(self, id: str | None, configuration: Dict[str, Any] = {}) QgsProcessingAlgorithm | None[source]

Creates a new instance of an algorithm by its ID. If no matching algorithm is found, None is returned. Callers take responsibility for deleting the returned object.

The configuration argument allows passing of a map of configuration settings to the algorithm, allowing it to dynamically adjust its initialized parameters and outputs according to this configuration. This is generally used only for algorithms in a model, allowing them to adjust their behavior at run time according to some user configuration.

See also

algorithms()

See also

algorithmById()

Parameters:
  • id (Optional[str])

  • configuration (Dict[str, Any] = {})

Return type:

Optional[QgsProcessingAlgorithm]

parameterType(self, id: str | None) QgsProcessingParameterType | None[source]

Returns the parameter type registered for id.

Added in version 3.2.

Parameters:

id (Optional[str])

Return type:

Optional[QgsProcessingParameterType]

signal parameterTypeAdded(type: QgsProcessingParameterType)[source]

Emitted when a new parameter type has been added to the registry.

Added in version 3.2.

Parameters:

type (QgsProcessingParameterType)

signal parameterTypeRemoved(type: QgsProcessingParameterType)[source]

Emitted when a parameter type has been removed from the registry and is about to be deleted.

Added in version 3.2.

Parameters:

type (QgsProcessingParameterType)

parameterTypes(self) List[QgsProcessingParameterType]

Returns a list with all known parameter types.

Added in version 3.2.

Return type:

List[QgsProcessingParameterType]

signal providerAdded(id: str)[source]

Emitted when a provider has been added to the registry.

Parameters:

id (str)

providerById(self, id: str | None) QgsProcessingProvider | None[source]

Returns a matching provider by provider ID.

Parameters:

id (Optional[str])

Return type:

Optional[QgsProcessingProvider]

signal providerRemoved(id: str)[source]

Emitted when a provider is removed from the registry

Parameters:

id (str)

providers(self) List[QgsProcessingProvider]

Gets list of available providers.

Return type:

List[QgsProcessingProvider]

removeParameterType(self, type: QgsProcessingParameterType | None)[source]

Unregister a custom parameter type from processing. The type will be deleted. Will emit parameterTypeRemoved.

Added in version 3.2.

Parameters:

type (Optional[QgsProcessingParameterType])

removeProvider(self, provider: QgsProcessingProvider | None) bool[source]

Removes a provider implementation from the registry (the provider object is deleted). Returns False if the provider could not be removed (eg provider does not exist in the registry).

See also

addProvider()

Parameters:

provider (Optional[QgsProcessingProvider])

Return type:

bool

removeProvider(self, providerId: str | None) bool[source]

Removes a provider implementation from the registry (the provider object is deleted). Returns False if the provider could not be removed (eg provider does not exist in the registry).

See also

addProvider()

Parameters:

providerId (Optional[str])

Return type:

bool