utils - Utility functions¶
-
pinspect.utils.
getmembers
(obj_class)[source]¶ - Parameters
- obj_classtype
An object class.
- Returns
- member_namesset
A set of method and attribute names of the obj_class type.
-
pinspect.utils.
to_pyvis
(graph, layout=True)[source]¶ This method takes an exisitng Networkx graph and translates it to a PyVis graph format that can be accepted by the VisJs API in the Jinja2 template.
- Parameters
- graphnx.DiGraph
NetworkX directed graph.
- layoutbool
Use hierarchical layout if this is set.
- Returns
- netNetwork
PyVis Network
-
pinspect.utils.
to_string
(graph, source, prefix='')[source]¶ Traverse the graph and yield its string representation.
- Parameters
- graphnx.DiGraph
Graph, obtained by GraphBuilder.
- sourceint
Source node id.
- prefixstr
This prefix will be accumulated in a full call history during successive calls of to_string().
- Returns
- generator
Generator of string traversal of the graph.