Tiny timing helper for printing elapsed times with call-site context
Project description
gadget
A tiny helper for quick timing/debug prints with file and line context.
Install
From a local checkout
pip install .
Directly from GitHub
pip install "git+https://github.com/s-maddrellmander/gadget.git"
Editable install (for development)
pip install -e .
Usage
Functional API
from gadget import gadget, gadget_reset, gadget_config
gadget("start")
# ... some code ...
gadget("after step")
gadget("phase 1", group="build")
gadget("phase 2", group="build")
gadget_reset("build")
gadget_config(verbose=False) # disable output globally
Class-based API
from gadget import Gadget
timer = Gadget(verbose=True)
timer("start")
# ... some code ...
timer("step", group="build")
timer.reset("build")
timer.reset() # reset all groups
Install from PyPI
pip install gadget-timer
Notes
-
Package name on PyPI is
gadget-timer. -
Import path is still
gadget. -
For Git installs, the repository URL is:
pip install "git+https://github.com/s-maddrellmander/gadget.git"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gadget_timer-0.1.0.tar.gz.
File metadata
- Download URL: gadget_timer-0.1.0.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8d3234886c89e2c242b12bf7f5e6bb180fbda0057fac7f5943bec17f4869eb2
|
|
| MD5 |
d1cbd78e2a55931097026ff3a33fd5d4
|
|
| BLAKE2b-256 |
b5a4396308aaf1d2617f1279c0b8fe0691bd69b26dbafbd01cf1eeffc5b1a8b5
|
Provenance
The following attestation bundles were made for gadget_timer-0.1.0.tar.gz:
Publisher:
publish-pypi.yml on s-maddrellmander/gadget
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gadget_timer-0.1.0.tar.gz -
Subject digest:
a8d3234886c89e2c242b12bf7f5e6bb180fbda0057fac7f5943bec17f4869eb2 - Sigstore transparency entry: 947234375
- Sigstore integration time:
-
Permalink:
s-maddrellmander/gadget@af916c7d3c2ec8ca85fc43d4d45dead4fb579a4c -
Branch / Tag:
refs/heads/main - Owner: https://github.com/s-maddrellmander
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@af916c7d3c2ec8ca85fc43d4d45dead4fb579a4c -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file gadget_timer-0.1.0-py3-none-any.whl.
File metadata
- Download URL: gadget_timer-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
471caa6cadedcd2a5364f1abc0c2d985af2afea41d8ca1d597183cb8c35065c7
|
|
| MD5 |
a64b83444a20084bea2882bd14ab3a3d
|
|
| BLAKE2b-256 |
266a2889453dc0f85f70d308bc79aba9b30973587518055c9ba66d0496e7f397
|
Provenance
The following attestation bundles were made for gadget_timer-0.1.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on s-maddrellmander/gadget
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gadget_timer-0.1.0-py3-none-any.whl -
Subject digest:
471caa6cadedcd2a5364f1abc0c2d985af2afea41d8ca1d597183cb8c35065c7 - Sigstore transparency entry: 947234377
- Sigstore integration time:
-
Permalink:
s-maddrellmander/gadget@af916c7d3c2ec8ca85fc43d4d45dead4fb579a4c -
Branch / Tag:
refs/heads/main - Owner: https://github.com/s-maddrellmander
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@af916c7d3c2ec8ca85fc43d4d45dead4fb579a4c -
Trigger Event:
workflow_dispatch
-
Statement type: