Skip to content

Click Lazy Loading Group

elva.click_lazy_group

Module defining a lazy loading for CLI.

Classes:

  • LazyGroup

    A command group that imports the actual implementation only when needed.

LazyGroup(import_name, **kwargs)

Bases: Group

A command group that imports the actual implementation only when needed.

This allows for more resilient CLIs where the top-level command does not fail when a subcommand is broken enough to fail at import time.

Source code in src/elva/click_lazy_group.py
def __init__(self, import_name, **kwargs):
    self._import_name = import_name
    super().__init__(**kwargs)