objgraph
is a module that lets you visually explore Python object graphs.
You'll need graphviz if you want to draw the pretty graphs.
I recommend xdot for interactive use.
pip install xdot
should suffice; objgraph will automatically look for it
in your PATH
.
pip install objgraph
or download it from PyPI.
Documentation lives at https://mg.pov.lt/objgraph.
I've developed a set of functions that eventually became objgraph when I was hunting for memory leaks in a Python program. The whole story -- with illustrated examples -- is in this series of blog posts:
The source code can be found in this Git repository: https://github.com/mgedmin/objgraph.
To check it out, use git clone https://github.com/mgedmin/objgraph
.
Report bugs at https://github.com/mgedmin/objgraph/issues.