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 | None)

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 | None[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