objgraph is a module that lets you visually explore Python object graphs. I've used it in the past to go hunt for memory leaks in Python programs as described by this series of blog posts:
You'll need graphviz if you want to draw pretty graphs.
Try this in a Python shell:
>>> x = [] >>> y = [x, [x], dict(x=x)] >>> import objgraph >>> objgraph.show_refs([y])
You should see a graph like this:
![[graph of objects reachable from y]](sample-graph.png)
Now try
>>> objgraph.show_backrefs([x])
and you'll see
![[graph of objects from which y is reachable]](sample-backref-graph.png)
You'll have to rely on pydoc objgraph. Sorry.
easy_install objgraph or download it from PyPI
The source code can be found in this Bazaar repository: https://code.launchpad.net/~mgedmin/objgraph/trunk.
To check it out, use bzr get lp:objgraph.
Report bugs at https://bugs.launchpad.net/objgraph.