rpymostat_common.loader module


Return a dict of variable names that klass’s init method takes, to string descriptions of them (if present).

Parameters:klass (abc.ABCMeta) – the class to get varnames for (from its __init__ method)

Given a docstring, attempt to parse out all :param foo: and :type foo: directives and their matching strings, collapsing whitespace. Return a dict of keys ‘params’ and ‘types’, each being a dict of name to string.

Parameters:docstring (str) – docstring to parse
Return type:dict

Given a list of class objects, print their names, along with their _description attributes (if present) and any arguments they accept. Used in building dynamic CLI help.

rpymostat_common.loader.load_classes(entrypoint_name, superclass=None)[source]

Attempt to load all pkg_resources entrypoints matching the given name, and return a list of the objects they load (usually classes). If superclass is specified, restrict the returned list to those which are subclasses of superclass.

  • entrypoint_name (str) – name of the entrypoint to load
  • superclass (class or classinfo) – if specified, restrict the return value to only subclasses of this class / classinfo

list of loaded entrypoints (usually classes)

Return type: