module documentation

Classes and functions for working with command-line arguments alongside the argparse module.

Class DataclassArgFormatter Formatter for command-line arguments found from a dataclass.
Class TypeConverterFactory When instantiated with a type, returns a callable that converts a passed string to that type.
Function construct_arglist_from_locals Given a key-value dictionary, construct something we can pass to an argparse parser. Entries with None as their value will NOT be constructed into the list.
Function parse_args_of_dataclass Use the argparse package to read the fields of a DataClass. Fields that are "init" fields will be used as command-line arguments. A "description" entry will be looked for in a field's metadata dict, and used if it is found...
Variable re_empty_line Undocumented
Variable _lgr Undocumented
def construct_arglist_from_locals(dict_of_locals: dict[str, Any], n_positional_args: int = 0):

Given a key-value dictionary, construct something we can pass to an argparse parser. Entries with None as their value will NOT be constructed into the list.

def parse_args_of_dataclass(dataclass: type, argv: list[str] | tuple[str], show_help: bool = False, prog: str = None, description: str = None, arg_prefix: str = '', metadata_keys: list[str] = None) -> dict[str, Any]:

Use the argparse package to read the fields of a DataClass. Fields that are "init" fields will be used as command-line arguments. A "description" entry will be looked for in a field's metadata dict, and used if it is found. Type conversion is handled by converting command-line argument string to the field's type as specified in the field.type attribute. The type conversion uses TypeConverterFactory.

re_empty_line =

Undocumented

_lgr =

Undocumented