hansken_extraction_plugin.api.plugin_info
This module contains all definitions to describe meta data of a plugin, a.k.a. PluginInfo.
Classes
|
The author of an Extraction Plugin. |
|
This class represents the maturity level of an extraction plugin. |
|
Identifier of a plugin, consisting of domain, category and name. |
|
This information is used by Hansken to identify and run the plugin. |
|
PluginResources contains information about how many resources will be used for a plugin. |
|
TransformerLabel contains information about a transformer method that a plugin provides. |
- class Author(name: str, email: str, organisation: str)[source]
Bases:
object
The author of an Extraction Plugin.
This information can be retrieved by an end-user from Hansken.
- name: str
- email: str
- organisation: str
- class MaturityLevel(value)[source]
Bases:
Enum
This class represents the maturity level of an extraction plugin.
- PROOF_OF_CONCEPT = 0
- READY_FOR_TEST = 1
- PRODUCTION_READY = 2
- class PluginId(domain: str, category: str, name: str)[source]
Bases:
object
Identifier of a plugin, consisting of domain, category and name. Needs to be unique among all tools/plugins.
- domain: str
- category: str
- name: str
- class PluginResources(maximum_cpu: float | None = None, maximum_memory: int | None = None, maximum_workers: int | None = None)[source]
Bases:
object
PluginResources contains information about how many resources will be used for a plugin.
- maximum_cpu: float | None = None
CPU resources are measured in cpu units. One cpu is equivalent to 1 vCPU/Core for cloud providers and 1 hyperthread on bare-metal Intel processors. Also, fractional requests are allowed. A plugin that asks 0.5 CPU uses half as much CPU as one that asks for 1 CPU.
- maximum_memory: int | None = None
Max usable memory for a plugin, measured in megabytes.
- maximum_workers: int | None = None
The number of concurrent workers(i.e. traces that can be processed).
- class TransformerLabel(method_name: str, parameters: Dict[str, str], return_type: str)[source]
Bases:
object
TransformerLabel contains information about a transformer method that a plugin provides.
It is mainly used for storing the properties (name, arguments, return type) of a transformer in PluginInfo objects. Unlike the Transformer class it does not contain the actual function reference to the transformer itself.
- method_name: str
The parameters of the function where the key is the parameter name and the value is the type of the parameter.
- parameters: Dict[str, str]
The return type of the parameter. See api.Transformer class for supported types.
- return_type: str
- class PluginInfo(id: ~hansken_extraction_plugin.api.plugin_info.PluginId, version: str, description: str, author: ~hansken_extraction_plugin.api.plugin_info.Author, maturity: ~hansken_extraction_plugin.api.plugin_info.MaturityLevel, matcher: str, webpage_url: str, license: str | None = None, deferred_iterations: int = 1, resources: ~hansken_extraction_plugin.api.plugin_info.PluginResources | None = None, transformers: ~typing.List[~hansken_extraction_plugin.api.plugin_info.TransformerLabel] = <factory>)[source]
Bases:
object
This information is used by Hansken to identify and run the plugin.
Note that the build_plugin.py build script is used to build a plugin docker image with PluginInfo docker labels.
- version: str
version of the plugin
- description: str
short description of the functionality of the plugin
- maturity: MaturityLevel
maturity level, see MaturityLevel
- matcher: str
this matcher selects the traces offered to the plugin
- webpage_url: str
plugin url
- license: str | None = None
license of this plugin
- deferred_iterations: int = 1
number of deferred iterations (1 to 20), nly for deferred plugins (optional)
- resources: PluginResources | None = None
Populated dynamically in pack.plugin_info by collecting all @transformer methods. Do not assign manually.
- transformers: List[TransformerLabel]