qhana_plugin_runner.util.plugins module

class qhana_plugin_runner.util.plugins.QHAnaPluginBase(app: Flask | None)

Bases: object

description: str
get_api_blueprint() Blueprint

Get the api blueprint that bundles the api endpoints of this plugin.

Raises:

NotImplementedError – if the plugin does not provide a blueprint

Returns:

The blueprint that holds the plugin api.

Return type:

Blueprint

static get_plugins() Dict[str, QHAnaPluginBase]
get_requirements() str

Get the plugin dependencies as a string in the requirements.txt format.

Raises:

NotImplementedError – if the plugin has no external dependencies (other than the plugin runner)

Returns:

the python dependencies of the plugin

Return type:

str

has_api: ClassVar[bool] = False
property identifier: str

An url safe identifier based on name and version of the plugin.

init_app(app: Flask)
instance: ClassVar[QHAnaPluginBase]
name: ClassVar[str]
property parsed_version: Version

The parsed version string as a Version that can be compared to other Versions.

Raises:

Exception – if the version does not conform to PEP 440

Returns:

the parsed and comparable version

Return type:

Version

tags: ClassVar[List[str]] = []
version: ClassVar[str]
qhana_plugin_runner.util.plugins.plugin_identifier(name: str, version: str)
qhana_plugin_runner.util.plugins.register_plugins(app: Flask)

Load and register QHAna plugins in the locations specified by the app config.

Parameters:

app (Flask) – the app instance to register the plugins with