cowbird.cli

Submodules

Package Contents

Functions

get_logger_parser(→ argparse.ArgumentParser)

subparser_help(→ SubParserArgs)

Generates both fields with the same description as each parameter is used in different context.

get_logger(→ logging.Logger)

Immediately sets the logger level to avoid duplicate log outputs from the root logger and this logger when

main(→ Optional[int])

Automatically groups all sub-helper CLI listed in cowbird.cli as a common cowbird CLI entrypoint.

Attributes

ParserMaker

ParserRunner

LOGGER

cowbird.cli.ParserMaker[source]
cowbird.cli.ParserRunner[source]
cowbird.cli.get_logger_parser() argparse.ArgumentParser[source]
cowbird.cli.subparser_help(description: str, parent_parser: argparse.ArgumentParser | None = None) SubParserArgs[source]

Generates both fields with the same description as each parameter is used in different context.

Field help is printed next to the subparser name when parent parser is called with --help. Field description populates the help details under the usage command when calling child parser --help.

cowbird.cli.get_logger(name: str, level: int | None = None, force_stdout: bool = None, message_format: str | None = None, datetime_format: str | None = None) logging.Logger[source]

Immediately sets the logger level to avoid duplicate log outputs from the root logger and this logger when level is logging.NOTSET.

cowbird.cli.LOGGER[source]
cowbird.cli.main(args: Sequence[str] | None = None) int | None[source]

Automatically groups all sub-helper CLI listed in cowbird.cli as a common cowbird CLI entrypoint.

Dispatches the provided arguments to the appropriate sub-helper CLI as requested. Each sub-helper CLI must implement functions make_parser and main to generate the arguments and dispatch them to the corresponding caller.