Skip to content

Instantly share code, notes, and snippets.

@lazyoracle
Created May 31, 2021 13:56
Show Gist options
  • Save lazyoracle/93a29b63c0ba16161ba4023a8b922695 to your computer and use it in GitHub Desktop.
Save lazyoracle/93a29b63c0ba16161ba4023a8b922695 to your computer and use it in GitHub Desktop.
Creating static call graphs in Python using pyan3
pip install -U pyan3==1.1.1
pyan3 <path/to/file> --uses --no-defines --colored --grouped --annotated --dot > call-graph.dot
pip install graphviz
python
>>> from graphviz import render
>>> render('dot', 'png', 'call-graph.dot')
'call-graph.dot.png'
>>> render('dot', 'svg', 'call-graph.dot')
'call-graph.dot.svg'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment