hermes.commands.curate.base

Classes

_CurateSettings

Generic curation settings.

BaseCuratePlugin

Base class for curation plugins.

HermesCurateCommand

Curate the processed metadata before deposition.

Module Contents

class hermes.commands.curate.base._CurateSettings(/, **data: Any)

Bases: pydantic.BaseModel

Generic curation settings.

method: str = 'accept'
class hermes.commands.curate.base.BaseCuratePlugin(command, ctx)

Bases: hermes.commands.base.HermesPlugin

Base class for curation plugins.

command
ctx
__call__(command: hermes.commands.base.HermesCommand) None

Entry point of the callable.

This method runs the main logic of the plugin. It calls the other methods of the object in the correct order. Depending on the result of is_publication_approved the corresponding process_decision_*() method is called, based on the curation decision.

prepare()

Prepare the plugin.

This method may be used to perform preparatory tasks such as configuration checks, token permission checks, loading of resources, etc.

validate()

Validate the metadata.

This method performs the validation of the metadata from the data model.

create_report()

Create a curation report.

This method is responsible for creating any number of reports about the curation process. These reports may be machine-readable, human-readable, or both.

abstractmethod is_publication_approved() bool

Return the publication decision made through the curation process.

If publication is allowed, this method must return True, otherwise False.

process_decision_positive()

Process a positive curation decision.

This method is called if a positive publication decision was made in the curation process.

process_decision_negative()

Process a negative curation decision.

This method is called if a negative publication decision was made in the curation process. By default, a RuntimeError is raised, halting the execution.

class hermes.commands.curate.base.HermesCurateCommand(parser: argparse.ArgumentParser)

Bases: hermes.commands.base.HermesCommand

Curate the processed metadata before deposition.

command_name = 'curate'
settings_class
init_command_parser(command_parser: argparse.ArgumentParser) None

Initialize the command line arguments available for this specific HERMES sub-commands.

You should override this method to add your custom arguments to the command line parser of the respective sub-command.

Parameters:

command_parser – The command line sub-parser responsible for the HERMES sub-command.

__call__(args: argparse.Namespace) None

Execute the HERMES sub-command.

Parameters:

args – The namespace that was returned by the command line parser when reading the arguments.