pyprof2calltree
Help visualize profiling data from cProfile with kcachegrind and qcachegrind
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 pyprof2calltreeuv
uv add pyprof2calltreepoetry
poetry add pyprof2calltreeInstalling 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
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
tunatuna visualizes Python performance profiles in…
copyleft · top 15,000 on PyPI
flameprofConverts Python cProfile statistics into…
permissive · top 15,000 on PyPI
line-profilerline_profiler measures execution time on a…
permissive · top 5,000 on PyPI
django-cprofile-middlewareMiddleware that profiles Django view execution…
permissive · top 15,000 on PyPI
pytest-profilingPytest plugin that profiles test execution…
permissive · top 5,000 on PyPI
pyinstrumentPyinstrument is a statistical call-stack…
permissive · top 5,000 on PyPI
xprofXProf is a profiler for ML workloads that…
permissive · top 15,000 on PyPI
tensorboard-plugin-profileProvides a TensorBoard plugin and standalone…
permissive · top 5,000 on PyPI
snakevizSnakeViz is a web-based viewer for Python…
permissive · top 5,000 on PyPI
qm-octaveSDK for controlling Quantum Machine's Octave…
permissive · top 15,000 on PyPI