Permalink
1de71a3 Sep 15, 2013
96 lines (51 sloc) 2.81 KB

Command-line Usage

Synopsis

pycallgraph [OPTION]... OUTPUT_MODE [OUTPUT_OPTIONS] python_file.py

Description

OUTPUT_MODE can be one of graphviz, gephi and json. python_file.py is a python script that will be traced and afterwards, a call graph visualization will be generated.

General Arguments

Filtering Arguments

Graphviz Arguments

Examples

Create a call graph image called pycallgraph.png on myprogram.py:

pycallgraph graphviz -- ./myprogram.py

Create a call graph of a standard Python installation script with command line parameters:

pycallgraph graphviz --output-file=setup.png -- setup.py --dry-run install

Run Django's manage.py script, but since there are many calls within Django, and will cause a massively sized generated image, we can filter it to only trace the core Django modules:

pycallgraph -v --stdlib --include "django.core.*" graphviz -- ./manage.py syncdb --noinput