Skip to main content

step3: profit

A small, focused Python profiler built on sys.monitoring (Python 3.12+).

Installation

uv tool install step3  # recommended

Or run without installing:

uvx --from step3 profit

Or with pip: pip install step3

Usage

profit run — profile a script

profit run script.py

Focus on specific functions:

profit run script.py -p mymod:func1 -p mymod:func2

Compare two functions side by side:

profit run script.py -b mymod:func_old -p mymod:func_new

Run a module:

profit run -m mypackage.module

Pass arguments to the script after --:

profit run script.py -- --script-arg value

Options

Flag Description
-p TARGET Function to show (repeatable)
-b TARGET Baseline function for comparison
-m MODULE Run a module as a script
--sort Sort by cumulative, tottime, or calls (default: cumulative)
--limit N Max functions to show (default: 20)

Targets use importable names: mymod:MyClass.method or mymod.func.

profit timeit — profile a statement in a loop

profit timeit 'sum(range(1000))'

With setup code:

profit timeit 'f()' --setup 'from mymod import f'

Focus on specific functions:

profit timeit 'f()' --setup 'from mymod import f' -p mymod:f

Options

Flag Description
--setup STMT Setup statement (default: pass)
-n N Number of executions (default: auto)
-p TARGET Function to show (repeatable)
-b TARGET Baseline function for comparison
--sort Sort by cumulative, tottime, or calls (default: cumulative)
--limit N Max functions to show (default: 20)

Global options

Flag Description
--no-color Disable colored output

Python API

Context manager — profile a block of code:

from step3 import profit

with profit as p:
    do_work()

p.print_stats()

Decorator — profile a specific function:

from step3 import profit

@profit
def my_func():
    ...

my_func()
profit.print_stats()

Requirements

  • Python 3.12+

Metadata

Release files for step3 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for step3 0.1.0
File Size Uploaded Provenance
step3-0.1.0.tar.gz 17.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for step3 0.1.0
File Interpreter ABI Platform
step3-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 32.1 kB

Release files / step3-0.1.0.tar.gz

Download URL step3-0.1.0.tar.gz
Size 17.7 kB
Tags Source
SHA-256 checksum
How to use checksums
48f3d2ef20309c60bf79efc1dbfe042aa78b14272e1483b9d1ea29234d7e1fc3
BLAKE2b-256 checksum
How to use checksums
c649aab416126bbe1f936a4180fecaf57ae43e6b02e8bb7826ee17de6a863e63
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / step3-0.1.0-py3-none-any.whl

Download URL step3-0.1.0-py3-none-any.whl
Size 14.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fde2174c06e11cd1988e1e557d3357e7bee981eaea656470b2ac5352f5195515
BLAKE2b-256 checksum
How to use checksums
24ba7ae4410e739dc5e8a95f41ffc9c7abffd5f5f0dd0aeceaf3a62e75f22df8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for step3 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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