PYCALLGRAPH(1)

πŸ“¦ version 2.1.6, in fedora 43, fedora 44

πŸ‘‘ 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 of graphviz or gephi. 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 either neato, fdp, sfdp, twopi, or circo. 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. πŸŽ€


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