structoscope package

structoscope.lib

class structoscope.lib.Scope(dataMemberName=None, childrenMemberName=None)

Bases: object

The Scope class is a wrapper around a single visualization window

Parameters
  • childMemberName – The name of the member containing the data of the node object

  • childrenMemberName (str) – The name of the member containing the children of the node object

_displayGraph(graph)

Converts the graph into a PNG image and displays it as a plot

Parameters

graph (graphviz.Digraph) – The graph object to display

print(data, raw=False)

Display a visualization of an arbitrary Python object. Supports lists, dictionaries and trees.

Parameters
  • data (Object) – The object to visualize

  • raw (bool) – If true returns a string representing the dot-notation graph

static wait(secs)

Block the main thread for any number of seconds

Parameters

secs (float) – Amount of time to wait for, in seconds

structoscope.slist

class structoscope.slist.List

Bases: object

_findNestedLists(data, result=None)

Finds every nested array in the supplied data and returns is as a flat, one-dimensional list.

Parameters
  • data (list) – The multi-dimensional list

  • result – The one-dimensional list holding the nested lists

_getLabelForList(data)

Creates the label for a single graph node representing a list. This label is formatted as an HTML-like markup language specific to the Graphviz library.

Parameters

data (list) – The list populating the label

makeGraph(data)

Creates a graph to visualize a Python list

Parameters

data (list) – The list to visualize

structoscope.sdict

class structoscope.sdict.Dict

Bases: object

_getLabelForDict(data)

Creates the label for a single graph node representing a dictionary. This label is formatted as an HTML-like markup language specific to the Graphviz library.

Parameters

data (dict) – The dictionary populating the label

makeGraph(data)

Creates a graph to visualize of a Python dictionary

Parameters

data (dict) – The dictionary to visualize

structoscope.stree

class structoscope.stree.Tree(members)

Bases: object

_findChildren(data, result=None)

Finds every node in the supplied tree and returns is as a flat, one-dimensional list.

Parameters
  • data (Object) – The root of the tree

  • result – The one-dimensional list holding the nodes

_getLabelForNode(data)

Creates the label for a single graph node representing the node of a tree. This label is formatted as an HTML-like markup language specific to the Graphviz library.

Parameters

data (Object) – The node populating the label

makeGraph(data)

Creates a graph to visualize a tree

Parameters

data (Object) – The root object of the tree to visualize