hyrax.verbs.verb_registry

Attributes

logger

VERB_REGISTRY

Classes

Verb

Base class for all hyrax verbs

Functions

hyrax_verb(→ type[Verb])

Decorator to register a hyrax verb

all_verbs(→ list[str])

Returns all verbs that are currently registered

all_class_verbs(→ list[str])

Returns all verbs that are currently registered with a class-based implementation

is_verb_class(→ bool)

Returns true if the verb has a class based implementation

fetch_verb_class(→ Optional[type[Verb]])

Gives the class object for the named verb

Module Contents

logger[source]
class Verb(config)[source]

Bases: abc.ABC

Base class for all hyrax verbs

__init__()[source]

Overall initialization for all verbs that saves the config

add_parser_kwargs: dict[str, str][source]
config[source]
VERB_REGISTRY: dict[str, type[Verb] | None][source]
hyrax_verb(cls: type[Verb]) type[Verb][source]

Decorator to register a hyrax verb

all_verbs() list[str][source]

Returns all verbs that are currently registered

all_class_verbs() list[str][source]

Returns all verbs that are currently registered with a class-based implementation

is_verb_class(cli_name: str) bool[source]

Returns true if the verb has a class based implementation

Parameters:

cli_name (str) – The name of the verb on the command line interface

Returns:

True if the verb has a class-based implementation

Return type:

bool

fetch_verb_class(cli_name: str) type[Verb] | None[source]

Gives the class object for the named verb

Parameters:

cli_name (str) – The name of the verb on the command line interface

Returns:

The verb class or None if no such verb class exists.

Return type:

Optional[type[Verb]]