hermes.commands.base
Classes
Root class for HERMES configuration model. |
|
Base class for a HERMES workflow command. |
|
Base class for all HERMES plugins. |
|
Usage docs: https://docs.pydantic.dev/2.10/concepts/models/ |
|
Show help page and exit. |
Module Contents
- class hermes.commands.base.HermesSettings(_case_sensitive: bool | None = None, _nested_model_default_partial_update: bool | None = None, _env_prefix: str | None = None, _env_file: pydantic_settings.sources.DotenvType | None = ENV_FILE_SENTINEL, _env_file_encoding: str | None = None, _env_ignore_empty: bool | None = None, _env_nested_delimiter: str | None = None, _env_parse_none_str: str | None = None, _env_parse_enums: bool | None = None, _cli_prog_name: str | None = None, _cli_parse_args: bool | list[str] | tuple[str, Ellipsis] | None = None, _cli_settings_source: pydantic_settings.sources.CliSettingsSource[Any] | None = None, _cli_parse_none_str: str | None = None, _cli_hide_none_type: bool | None = None, _cli_avoid_json: bool | None = None, _cli_enforce_required: bool | None = None, _cli_use_class_docs_for_groups: bool | None = None, _cli_exit_on_error: bool | None = None, _cli_prefix: str | None = None, _cli_flag_prefix_char: str | None = None, _cli_implicit_flags: bool | None = None, _cli_ignore_unknown_args: bool | None = None, _secrets_dir: pydantic_settings.sources.PathType | None = None, **values: Any)
Bases:
pydantic_settings.BaseSettings
Root class for HERMES configuration model.
- class hermes.commands.base.HermesCommand(parser: argparse.ArgumentParser)
Bases:
abc.ABC
Base class for a HERMES workflow command.
- Variables:
NAME – The name of the sub-command that is defined here.
- classmethod derive_settings_class(setting_types: Dict[str, Type]) None
Build a new Pydantic data model class for configuration.
This will create a new class that includes all settings from the plugins available.
- init_common_parser(parser: argparse.ArgumentParser) None
Initialize the common command line arguments available for all HERMES sub-commands.
- Parameters:
parser – The base command line parser used as entry point when reading command line arguments.
- 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.
- class hermes.commands.base.HermesPlugin
Bases:
abc.ABC
Base class for all HERMES plugins.
- abstract __call__(command: HermesCommand) None
Execute the plugin.
- Parameters:
command – The command that triggered this plugin to run.
- class hermes.commands.base.HermesHelpSettings(/, **data: Any)
Bases:
pydantic.BaseModel
Usage docs: https://docs.pydantic.dev/2.10/concepts/models/
A base class for creating Pydantic models.
- __pydantic_decorators__
Metadata containing the decorators defined on the model. This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
- __pydantic_generic_metadata__
Metadata for generic models; contains data used for a similar purpose to __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these.
- __pydantic_parent_namespace__
Parent namespace of the model, used for automatic rebuilding of models.
- __pydantic_fields__
A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects.
- __pydantic_computed_fields__
A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
- class hermes.commands.base.HermesHelpCommand(parser: argparse.ArgumentParser)
Bases:
HermesCommand
Show help page and exit.
- 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.