hermes.commands.harvest.base
Classes
Base plugin that does harvesting. |
|
Generic harvesting settings. |
|
Harvest metadata from configured sources. |
Functions
Removes information on the specified harvest plugin from the given provenance document. |
Module Contents
- class hermes.commands.harvest.base.HermesHarvestPlugin
Bases:
hermes.commands.base.HermesPluginBase plugin that does harvesting.
- operations
The information recorded on the load operations executed by the plugin.
- Type:
list[tuple[dict[str, str], dict[str, str], dict[str, str]]]
TODO: describe the harvesting process and how this is mapped to this plugin.
- __call__(command: HermesHarvestCommand) hermes.model.SoftwareMetadata
Execute the hermes harvest plugin self.
- Parameters:
command (HermesHarvestCommand) – The command being executed.
- Returns:
The harvested metadata.
- Return type:
- load(func: Callable, source: Any, *args: Any | None, encoding: str | None = 'utf-8', **kwargs: Any | None) Any
Load some data from some source using some function so that the calls provenance information is recorded.
func(source, *args, **kwargs) will be executed.
- Parameters:
func (Callable) – The function used for loading the requested source.
source (Any) – The source the data is to be loaded from.
args (Any | None) – Additional positional arguments for the load.
encoding (str) – Encoding for loaded file, utf-8 is default.
kwargs (Any | None) – Additional keyword arguments for the load.
- Returns:
The result of the load operation.
- Return type:
Any
- class hermes.commands.harvest.base.HarvestSettings(/, **data: Any)
Bases:
pydantic.BaseModelGeneric harvesting settings.
- hermes.commands.harvest.base.remove_harvest_plugin_from_prov_doc(prov_doc: hermes.model.provenance.ld_prov.ld_prov_list, plugin: str) None
Removes information on the specified harvest plugin from the given provenance document.
- Parameters:
prov_doc (ld_prov_list) – The provenance document the plugins information is to be removed from.
plugin (str) – The name of the plugin of which the information is to be removed.
- Return type:
None
- class hermes.commands.harvest.base.HermesHarvestCommand(parser: argparse.ArgumentParser)
Bases:
hermes.commands.base.HermesCommandHarvest metadata from configured sources.
- args
The namespace that was returned by the command line parser when reading the arguments.
- Type:
Namespace
- __call__(args: argparse.Namespace) None
Execute the hermes command self.
- Parameters:
args (Namespace) – The namespace that was returned by the command line parser when reading the arguments.
- Return type:
None
- Raises:
MisconfigurationError – If no plugin is configured to be run.
HermesPluginRunError – If all plugin runs failed.
- classmethod init_provenance_document() hermes.model.provenance.ld_prov.ld_prov_list
Loads or creates a provenance document.
- Returns:
The loaded or created provenance document.
- Return type: