This project has been archived by its maintainers, and is no longer receiving any updates.
Handit Core (Python)
Lightweight function and HTTP tracing for Python applications with zero configuration. Captures function calls/returns with arguments and return values, and outgoing HTTP requests/responses (including bodies) for requests and httpx. Events are buffered in-memory and written once at process exit to handit_events.jsonl.
Install
Build from source (requires Rust and Python toolchain):
python -m pip install maturin
python -m maturin develop --release -m python/pyproject.toml
Quick start
from handit import session, tracing
import requests
@tracing(agent="demo")
def fetch_user(user_id: int) -> dict:
resp = requests.get(f"https://httpbin.org/anything/{user_id}")
return resp.json()
if __name__ == "__main__":
with session(tag="demo-session"):
fetch_user(42)
# Events will be written to ./handit_events.jsonl at exit
What is captured
- Function events: call/return/exception
- Arguments preview on call
- Return value preview on return
- HTTP events (client-side)
- requests/httpx: method, URL, headers, request body; response status, headers, body, size, duration, error
- aiohttp: method, URL, headers; response status, headers (bodies are not captured by default)
Behavior
- Zero-config: HTTP instrumentation is enabled on import; no environment variables are required.
- Noise reduction: internal library frames and stdlib/site-packages are excluded by default.
- Output: events are buffered and flushed once at exit to
handit_events.jsonl.- Override path via env
HANDIT_OUTPUT_FILE=./path/file.jsonl.
- Override path via env
Advanced
- Manual flush during runtime:
from handit_core import handit_core_native as native
native.flush_events_to_file("./handit_events.jsonl")
- Optional envs (all have safe defaults):
HANDIT_INCLUDE/HANDIT_EXCLUDE: module/function regex filtersHANDIT_MAX_STR(default 256),HANDIT_MAX_LOCALS(default 64)HANDIT_REDACT: regex for keys to redact in previewsHANDIT_CAPTURE_ONLY_CWD(default true)
Notes
- Capturing full HTTP bodies may include sensitive data. Ensure you comply with your data policy.
- For
aiohttpstreamed bodies, body capture can be added with explicit buffering middleware if needed.
Metadata
Release files for handit-core 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| handit_core-0.0.1-cp310-cp310-macosx_11_0_arm64.whl | CPython 3.10 | CPython 3.10 | macOS 11.0+ ARM64 | Details for handit_core-0.0.1-cp310-cp310-macosx_11_0_arm64.whl |
Release files / handit_core-0.0.1-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | handit_core-0.0.1-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 2.5 MB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
6b42979c19c4f88a3132c817ce75996a6b5f752fc8244420136dee99ceb2f12c
|
|
BLAKE2b-256 checksum How to use checksums |
00604e0c773ef7f9f90d4db10d1b43023ffb54f523500c05521ad372f5e734c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.12
|
Security for handit-core 0.0.1
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.