inspect#

Python inspect helper functions.

Module Contents#

Functions#

get_classes(→ Dict[str, Type[Any]])

Return a dictionary of class names by class types.

make_uml_diagram(→ str)

Generate a UML diagram of a given module or class.

get_classes(*modules: types.ModuleType) Dict[str, Type[Any]][source]#

Return a dictionary of class names by class types.

from quantify_scheduler.helpers import inspect
from my_module import foo

class_dict: Dict[str, type] = inspect.get_classes(foo)
print(class_dict)
// { 'Bar': my_module.foo.Bar }
Parameters:

modules – Variable length of modules.

Returns:

A dictionary containing the class names by class reference.

make_uml_diagram(obj_to_plot: types.ModuleType | Type[Any], options: list[str]) str[source]#

Generate a UML diagram of a given module or class.

This function is a wrapper of pylint.pyreverse.

Parameters:
  • obj_to_plot – The module or class to visualize

  • options – A string containing the plotting options for pyreverse

Returns:

The name of the generated png image