Skip to main content

Table-based exploration tool for Python profiling data (pstats files).

Project description

https://img.shields.io/github/actions/workflow/status/adamchainz/profiling-explorer/main.yml.svg?branch=main&style=for-the-badge https://img.shields.io/badge/Coverage-70%25-success?style=for-the-badge https://img.shields.io/pypi/v/profiling-explorer.svg?style=for-the-badge https://img.shields.io/badge/code%20style-black-000000.svg?style=for-the-badge pre-commit

Table-based exploration tool for Python profiling data (pstats files).

profiling-explorer screenshot

Read more in the introductory blog post.


Get better at command line Git with my book Boost Your Git DX.


Requirements

Python 3.10 to 3.14 supported.

Installation

  1. Install with pip:

    python -m pip install profiling-explorer

Usage

profiling-explorer reads pstats files as generated by Python’s profilers: profiling.tracing (called cProfile on Python < 3.15) and profiling.sampling (new in Python 3.15). To use it, first generate a profile file, for example by running your program under cProfile:

$ python -m cProfile -o example.pstats example.py

(Also runnable as python -m profiling.tracing instead on Python 3.15+.)

Then run profiling-explorer with the generated file:

$ profiling-explorer example.pstats

The report will open in your web browser, and you can explore the profile data with the interactive interface. Features:

  • Click the calls, internal ms, or cumulative ms column headers to sort by that column.

  • Use the search box to filter by filename or function name. Separate multiple search terms by spaces to match records that contain all terms.

  • Press a keyboard shortcut to focus the search box: /, Control+K, or Command+K. Select some text first, like a filename, to pre-fill the search box with that text.

  • Hover by a filename + line number pair to reveal the copy button, which copies the location to your clipboard for faster opening.

  • Click the callers or callees links on the right of a row to see the callers or callees of that function.

Full help:

usage: profiling-explorer [-h] [--port PORT] [--dev] FILE

positional arguments:
  FILE         The pstats data file to explore.

options:
  -h, --help   show this help message and exit
  --port PORT  Port for the local web server (default: 8099).
  --dev        Run in development mode (enables server reload and debug mode).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

profiling_explorer-1.1.0.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

profiling_explorer-1.1.0-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file profiling_explorer-1.1.0.tar.gz.

File metadata

  • Download URL: profiling_explorer-1.1.0.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for profiling_explorer-1.1.0.tar.gz
Algorithm Hash digest
SHA256 3220b7571e6c936150f8e69da4d35ea56334a6e35afa2910f876dbd14e1dc1bb
MD5 d74d2f7e886b4399be56973a299ad79c
BLAKE2b-256 17bb8a373d6e9a440f906bb91ca85b6bb715fe6607154be8949a6f5a3fa6b101

See more details on using hashes here.

Provenance

The following attestation bundles were made for profiling_explorer-1.1.0.tar.gz:

Publisher: main.yml on adamchainz/profiling-explorer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file profiling_explorer-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for profiling_explorer-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 db4626092eb21046c9df1d2bb2533ddce4479eb34062d9934130196ac3e9dc68
MD5 3787f05ae11f188fc69a04bd77d8ef2f
BLAKE2b-256 7af3d7b47ec08d5fda9021e3dfc637df14b365c94e7856fd967752fe27eba2c6

See more details on using hashes here.

Provenance

The following attestation bundles were made for profiling_explorer-1.1.0-py3-none-any.whl:

Publisher: main.yml on adamchainz/profiling-explorer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page