Skip to main content

CircleCI

Python Call Graph

Note: This is a fork of the original pycallgraph since it became unmaintained.

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

Project Status

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 fork needs documentation. Feel free to contribute :)

License: GNU GPLv2

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

OS dependencies:

  • Graphviz is open source software and can be installed on Ubuntu/Debian via apt install graphviz, or equivalent on other distributions. See here for more information.

Installation is easy as:

pip install pycallgraph2

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 pycallgraph2 import PyCallGraph
from pycallgraph2.output import GraphvizOutput

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

Documentation

Documentation for the fork is a work in progress.

Metadata

Release files for pycallgraph2 1.1.3

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

Source distribution (sdist)

Source distribution for pycallgraph2 1.1.3
File Size Uploaded
pycallgraph2-1.1.3.tar.gz 28.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pycallgraph2 1.1.3
File Interpreter ABI Platform
pycallgraph2-1.1.3-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 58.9 kB

Release files / pycallgraph2-1.1.3.tar.gz

Download URL pycallgraph2-1.1.3.tar.gz
Size 28.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f5d02c1ea446cd7051ad886fc61c6698c1d1f6b759ac5e32ddec5fab153b73c8
BLAKE2b-256 checksum
How to use checksums
4bdc1f4a1d41daa3ae1a4f8d73f5cc9b1b99a13ad95304d5e5f0f6860abb2b15
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.5

Release files / pycallgraph2-1.1.3-py2.py3-none-any.whl

Download URL pycallgraph2-1.1.3-py2.py3-none-any.whl
Size 30.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
0e8eb7b8651074c549c6ea2efaee5bd953bcaf2fb028b8ad1abdbad7386eb306
BLAKE2b-256 checksum
How to use checksums
d57d636c4f8359f82c5b7dc022e59f67b1f3aa7a1875fa5e9ac00e5119daf4bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.5

Release history Release notifications | RSS feed

This release

1.1.3 This release

2 release files

1.1.2

2 release files

1.1.0

2 release files

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