Skip to main content

Welcome! Python Call Graph is a Python module that creates call graph visualizations for Python applications.

https://travis-ci.org/gak/pycallgraph.png https://coveralls.io/repos/gak/pycallgraph/badge.png?branch=develop https://pypip.in/v/pycallgraph/badge.png https://pypip.in/d/pycallgraph/badge.png

Screenshots

Click on the images below to see a larger version and the source code that generated them.

http://pycallgraph.slowchop.com/en/develop/_images/basic_thumb.png http://pycallgraph.slowchop.com/en/develop/_images/regexp_grouped_thumb.png http://pycallgraph.slowchop.com/en/develop/_images/regexp_ungrouped_thumb.png

Project Status

The latest version is 1.0.1 which was released on 2013-09-17, and is a backwards incompatbile from the previous release.

The project lives on GitHub, where you can report issues, contribute to the project by forking the project then creating a pull request, or just browse the source code.

The documentation needs some work stiil. Feel free to contribute :)

Features

  • Support for Python 2.7+ and Python 3.3+.

  • Static visualizations of the call graph using various tools such as Graphviz and Gephi.

  • Execute pycallgraph from the command line or import it in your code.

  • Customisable colors. You can programatically set the colors based on number of calls, time taken, memory usage, etc.

  • Modules can be visually grouped together.

  • Easily extendable to create your own output formats.

Quick Start

Installation is easy as:

pip install pycallgraph

You can either use the command-line interface for a quick visualization of your Python script, or the pycallgraph module for more fine-grained settings.

The following examples specify graphviz as the outputter, so it’s required to be installed. They will generate a file called pycallgraph.png.

The command-line method of running pycallgraph is:

$ pycallgraph graphviz -- ./mypythonscript.py

A simple use of the API is:

from pycallgraph import PyCallGraph
from pycallgraph.output import GraphvizOutput

with PyCallGraph(output=GraphvizOutput()):
    code_to_profile()

Documentation

Feel free to browse the documentation of pycallgraph for the usage guide and API reference.

Release files for pycallgraph 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pycallgraph 1.0.1
File Size Uploaded
pycallgraph-1.0.1.tar.gz 36.4 kB Details

Release files / pycallgraph-1.0.1.tar.gz

Download URL pycallgraph-1.0.1.tar.gz
Size 36.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b1262b0f9831da889c6e9a9a82a22267df497013cd2f5b36c39359a607c91e71
BLAKE2b-256 checksum
How to use checksums
ca2efafa56316bc2c5fbfbda898f964137c8b5ef33a876cb1f35a54ff6afbd60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.1 This release

1 release file

1.0.0

1 release file

0.5.1

0.5.0

0.4.1

0.4.0

0.3.1

0.3.0

0.2.0

0.1.0

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page