PYCALLGRAPH(1)
π PYCALLGRAPH β the Python Call Graph era
okay bestie, gather round, because this is the pycallgraph(1) manual page and it's literally about to make your Python scripts β¨visibleβ¨. it's a whole program that creates call graph visualizations from your Python scripts. yes. you get to see the call graph. iconic behaviour honestly. π
β¨ SYNOPSIS β¨
pycallgraph [OPTION]β¦ OUTPUT_MODE [OUTPUT_OPTIONS] python_file.py
π DESCRIPTION π
so pycallgraph is a program that creates call graph visualization from Python scripts. that's the whole vibe. π¦
OUTPUT_MODE can be one of graphviz or gephi. and python_file.py is a python script that will be traced β and afterwards, a call graph visualization will be generated. periodt. πΈ
π GENERAL ARGUMENTS π
<OUTPUT_MODE>β a choice ofgraphvizorgephi. pick your fighter. π₯-h,--helpβ shows a list of possible options for the command line. your little cheat sheet, no cap.-v,--verboseβ turns on verbose mode which will print out information of pycallgraph's state and processing. she's chatty and we love that for her. π¬-d,--debugβ turns on debug mode which will print out debugging information such as the raw Graphviz generated files. maximum transparency, we stan. π-ng,--no-groupsβ do not group modules in the results. by default this is turned on, and it will visually group together methods of the same module. heads up though: the technique of grouping does rely on the type of output used. π―-s,--stdlibβ when running a trace, also include the Python standard library. let the whole stdlib come to the function, fr fr. π-m,--memoryβ an experimental option which includes memory tracking in the trace. experimental, bestie β you've been warned. π§ͺ-t,--threadedβ an experimental option which processes the trace in another thread. this may or may not be faster. she's giving chaos, she's giving mystery. π
π¦ FILTERING ARGUMENTS π¦
-i,--include<pattern>β wildcard pattern of modules to include in the output. you can have multiple include arguments. stack 'em. π«Ά-e,--exclude<pattern>β wildcard pattern of modules to exclude in the output. you can have multiple include arguments. (yes, the original says "include" there too β we keep it exactly as it is, no notes. π)--include-pycallgraphβ by default pycallgraph filters itself out of the trace. enabling this will include pycallgraph in the trace. main character wants to be in her own movie. π--max-depthβ maximum stack depth to trace. any calls made past this stack depth are not included in the trace. draw the line, bestie. β
π GRAPHVIZ ARGUMENTS π
-l<tool>,--tool<tool>β modify the default Graphviz tool used by pycallgraph. it uses "dot", but can be changed to eitherneato,fdp,sfdp,twopi, orcirco. five whole alternates, pick your vibe. π‘
π 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
π«Ά AUTHOR π«Ά
pycallgraph was written by Gerald Kaszuba <pycallgraph@slowchop.com>. absolute legend, we are obsessed. π
this manual page was originally written by Jan Alonzo <jmalonzo@unpluggable.com>, for the Debian GNU/Linux system. thank you for your service. π
β COPYRIGHT β
2007-2024 Gerald Kaszuba, et al.
okay that's the whole page bestie, go trace something gorgeous π
and one last thing before you close the tab β this was pycallgraph 2.1.6, dated Jun 06, 2025. mwah. πβ¨
π¦ where this page comes from
- fedora 43: python3-python-call-graph 2.1.6-1.fc43 Β· GPL-2.0-only
- fedora 44: python3-python-call-graph 2.1.6-2.fc44 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms