skillfed

pyprof2calltree

Help visualize profiling data from cProfile with kcachegrind and qcachegrind

pyprof2calltree v1.4.5 169.9K downloads/30d#10,405 on PyPI169
Permissive license MIT Abandoned released

What it is and what it does

pyprof2calltree is a command-line and Python library tool that bridges Python's built-in cProfile profiler and the kcachegrind/qcachegrind graphical profiling viewers. It reads profiling statistics from cProfile (either from live profiler objects or saved .stats files) and converts them into the calltree format that kcachegrind understands, allowing you to explore call graphs, see function call counts, and identify performance bottlenecks visually.

The package provides both a command-line interface for batch conversion and Python functions (convert, visualize) for interactive use in shells or notebooks. It has no runtime dependencies, making installation straightforward, but it requires kcachegrind or qcachegrind to be installed separately on your system to actually view the results. The project is stable and production-ready but abandoned—no active development since early 2021.

Use it for:

  • Convert cProfile output to kcachegrind format for interactive exploration of function call hierarchies and execution time.
  • Profile Python scripts from the command line and automatically launch kcachegrind to visualize the results.
  • Save profiling data in calltree format for later analysis or sharing with team members using kcachegrind.
  • Integrate profiling visualization into interactive Python sessions or Jupyter notebooks for quick performance debugging.
  • Identify performance bottlenecks by visualizing which functions consume the most time and how often they are called.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Converts Python cProfile profiling data into kcachegrind/qcachegrind calltree format for interactive visualization of function call hierarchies and performance metrics.

Yes, if you already use kcachegrind or qcachegrind and need to profile Python code. The package is stable, has no dependencies, and does its job well. However, be aware it is abandoned—no updates since 2020. If you need profiling for modern Python versions or expect ongoing maintenance, consider whether your Python version and kcachegrind compatibility are confirmed before relying on it for critical workflows.

Install

pyprof2calltree on PyPI

pip

pip install pyprof2calltree

uv

uv add pyprof2calltree

poetry

poetry add pyprof2calltree

Installing pyprof2calltree

Before you install

High install friction due to lack of runtime dependencies but the package is abandoned—last release was 2020-04-19 and last commit 2021-02-28. No active maintenance means bug fixes or compatibility updates for newer Python versions are unlikely.

License in practice

MIT license is permissive and imposes no restrictions on use, modification, or distribution in your own projects.

Quickstart

pip install pyprof2calltree

from cProfile import Profile
from pyprof2calltree import convert, visualize

profiler = Profile()
profiler.runctx("code_to_profile()", globals(), locals())
visualize(profiler.getstats())  # opens kcachegrind
convert(profiler.getstats(), 'output.kgrind')  # save for later

Requires kcachegrind or qcachegrind to be installed on your system to visualize the converted profiling data; the package only handles conversion, not the viewer itself.

Verify before relying

  • Whether the package works reliably with Python versions beyond 3.8 (classifiers list 3.8 as the latest tested version).
  • Current compatibility with modern versions of kcachegrind/qcachegrind and whether the calltree format has remained stable.
  • Whether the Windows support mentioned in 1.4.3 changelog remains functional given the lack of recent maintenance.

Package facts

License MIT (permissive)
Python support not specified
Install friction high — source build required
Runtime dependencies none
Maintenance abandoned — 2,308 days since the last release
Last repo commit
First released
Downloads 169,946/month — #10,405 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pyprof2calltree-1.4.5.tar.gz

Keywords: profiler, visualization, programming, tool, kde, kcachegrind, qcachegrind

Development Status :: 5 - Production/StableEnvironment :: ConsoleEnvironment :: X11 Applications :: KDELicense :: OSI Approved :: MIT LicenseOperating System :: POSIXOperating System :: UnixProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Topic :: Desktop Environment :: K Desktop Environment (KDE)Topic :: Software DevelopmentTopic :: Software Development :: Quality AssuranceTopic :: System :: System ShellsTopic :: Utilities

Tags

cProfile visualizationkcachegrind converterprofiling data analysiscalltree format conversionperformance profiling toolqcachegrind integrationcall graph visualization
profilingvisualizationdebugging

More Software Development packages