proj_flow.base.inspect

The proj_flow.base.inspect provides unified access to function and class metadata used in argument parser, command and step metadata.

class proj_flow.base.inspect.Function(*args, **kwargs)

Replacement for callable() as universal argument type.

class proj_flow.base.inspect.Argument(name: str, type: type, metadata: List[Any])

Extracted argument type

name: str

Name of the argument

type: type

The type of the argument. If type was typing.Annotated, then this is the first argument to that annotation.

metadata: List[Any]

The list of metadata attached to the typing.Annotated, if there was any.

proj_flow.base.inspect.signature(call: Function) Generator[Argument, None, None]

Extract the arguments from the function and produces list of Argument objects.

Parameters:

call – Function to analyse.

Returns:

List of the parameters, in order they appeared in the definition.

proj_flow.base.inspect.type_name(t: type) str

Converts a type to simplified string representing that type.

Parameters:

t – Type to stringify.

Returns:

String representing the type.