cli_interface#

utils.cli_interface.init(args_objs, description=None, prog=None, epilog=None, formatter_class=<class 'rich_argparse.RichHelpFormatter'>)[source]#

DESCRIPTION:

This function initializes a Python ArgumentParser object in accordance with the specified argument SimpleNamespace objects and the respective keyword attributes.

Parameters:
args_objs: Tuple[SimpleNamespace]

A Python tuple of SimpleNamespace objects containing the mandatory, optional, and task arguments.

Returns:
parser: ArgumentParser

A Python ArgumentParser object.

Raises:
CLIInterfaceError:
  • raised if the attribute longname has not been specified in an args_obj SimpleNamespace object.

  • raised if an exception is encountered while initializing the CLI.

Return type:

ArgumentParser

utils.cli_interface.options(parser, validate_schema=False, schema_path=None)[source]#

DESCRIPTION:

This function defines a Python SimpleNamespace object containing both the mandatory and the ancillary CLI arguments.

Parameters:
parser: ArgumentParser

A Python ArgumentParser object containing the CLI arguments.

Raises:
CLIInterfaceError:
  • raised if the schema_path attribute is NoneType when attempting to validate the CLI argument schema.

Return type:

SimpleNamespace