skillfed

tuna

Visualize Python performance profiles

tuna v0.5.15 252.7K downloads/30d#8,537 on PyPI1,597
Copyleft license GPL-3.0-or-later Active released

What it is and what it does

tuna is a lightweight Python profile viewer that reads output from Python's built-in cProfile and importtime profilers and displays them in an interactive web interface. It was designed as a modern alternative to SnakeViz, focusing on accuracy: it only displays timing information that can be reliably reconstructed from profile data, avoiding the incorrect call-tree reconstructions that SnakeViz produces. The tool uses d3 and bootstrap for visualization and has no runtime dependencies, making it quick to install and run.

You generate a profile by running your Python code with cProfile or importtime, then pass the resulting file to tuna's command-line interface. tuna launches a web viewer showing the call tree, function timings, and performance bottlenecks. It also includes IPython magic commands for profiling code directly in notebooks, offering a drop-in replacement for the prun magic.

Use it for:

  • Identify which functions consume the most CPU time in a Python application.
  • Analyze import-time performance to find slow module initialization.
  • Debug performance regressions by comparing profiles across code versions.
  • Visualize call hierarchies to understand which code paths dominate execution time.
  • Profile IPython/Jupyter notebooks using the tuna magic command.

Worth the install?

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

tuna visualizes Python performance profiles in an interactive web interface, showing runtime and import-time profiling data with minimal dependencies.

Yes. tuna is actively maintained, has no runtime dependencies, supports current Python versions (3.10+), and solves a real problem—accurate profile visualization—that SnakeViz handles incorrectly. The GPLv3 license is a constraint for proprietary use but not a blocker for most development workflows. Install it if you need to understand where your Python code spends time.

Install

tuna on PyPI

pip

pip install tuna

uv

uv add tuna

poetry

poetry add tuna

Installing tuna

Before you install

Low friction: pure Python wheel with no runtime dependencies. Actively maintained as of June 2026, with 1597 repository stars and regular releases since 2018.

License in practice

GPLv3 copyleft license. Any derivative work or distribution must also be licensed under GPLv3; using tuna in proprietary projects requires careful consideration of linking and distribution obligations.

Quickstart

pip install tuna

python -mcProfile -o program.prof yourfile.py
tuna program.prof

Requires Python 3.10 or later.

Verify before relying

  • Whether the web interface requires a specific browser or JavaScript runtime to function.
  • Whether tuna can be used programmatically as a library or only as a CLI tool.
  • Performance characteristics when analyzing very large profile files.

Package facts

License GPL-3.0-or-later (copyleft)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 87 days since the last release
Last repo commit
First released
Downloads 252,687/month — #8,537 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: tuna-0.5.15-py3-none-any.whl

Keywords: performance, profile, visualization

Development Status :: 5 - Production/StableIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: User InterfacesTopic :: Utilities

Tags

python profile visualizationperformance profiling viewercprofile viewerpython runtime analysisimport time profilercall tree visualizationperformance bottleneck analysis
profilingperformance-analysisvisualization

More Utilities packages