Skip to main content

scope-profiler

Profile Python code regions—and optionally C, Fortran, MPI, NVTX, and LIKWID—with one consistent API and HDF5 output format.

pip install scope-profiler

Quick start

from scope_profiler import ProfileManager

with ProfileManager.session():

    @ProfileManager.profile("main")
    def main():
        with ProfileManager.profile_region("work"):
            sum(range(100))  # replace with the code you want to measure

    main()
# writes profiling_data.h5 and prints a summary

You can also profile a script without changing its source:

scope-profiler run my_script.py
scope-profiler inspect profiling_data.h5
scope-profiler plot default profiling_data.h5 -o figures
scope-profiler report profiling_data.h5 -o report.html

Example output

The plotting tools include duration summaries and timelines for finding expensive regions:

Duration summary

Gantt chart

The overhead benchmark measures the cost of each instrumentation mode:

python examples/benchmark_overhead.py

Profiling overhead by region type

Documentation

Development

pip install -e '.[dev]'
pytest

See AGENTS.md for the measured benchmark workflow used when optimizing this project.

Download files

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

Source Distribution

scope_profiler-0.4.1.tar.gz (313.8 kB view details)

Uploaded Source

Built Distribution

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

scope_profiler-0.4.1-py3-none-any.whl (367.4 kB view details)

Uploaded Python 3

File details

Details for the file scope_profiler-0.4.1.tar.gz.

File metadata

  • Download URL: scope_profiler-0.4.1.tar.gz
  • Upload date:
  • Size: 313.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for scope_profiler-0.4.1.tar.gz
Algorithm Hash digest
SHA256 d9c46027b6f5726bd0d649c7c28f93cb8c31442553ba266e4ca1cd6213af80f7
MD5 c647adef8dd140025a0593e7177ed5e8
BLAKE2b-256 c9e06e06caf1d35023285ff4a97479b372ee991ef1779cf6d07f51147a2cbc78

See more details on using hashes here.

Provenance

The following attestation bundles were made for scope_profiler-0.4.1.tar.gz:

Publisher: publish.yml on max-models/scope-profiler

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

File details

Details for the file scope_profiler-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: scope_profiler-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 367.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for scope_profiler-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5341b8ba61b7b2130331610d7e8f6d1d7a4171459040c6afd3b84fe756ff177e
MD5 df9510c221b48ae8329e2b5683eca176
BLAKE2b-256 e2b861b57ddb1ee38e5a7c551886e3bd42193a767dc8cd8c5e964b127be8b2b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for scope_profiler-0.4.1-py3-none-any.whl:

Publisher: publish.yml on max-models/scope-profiler

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

Release history Release notifications | RSS feed

0.5.0

2 files

0.4.2

2 files

This release

0.4.1 This release

2 files

0.4.0

2 files

0.3.6

2 files

0.3.5

2 files

0.3.4

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.8

2 files

0.2.7

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2

2 files

0.1.11

2 files

0.1.10

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1

2 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