TraceAct
X-ray vision for Python code.
TraceAct is a lightweight Python package for action-level tracing. It records the full story of what happens when a function runs, including every step taken, resource touched, event recorded, and failure encountered, so you or your agent can understand what actually happened.
Install
pip install traceact
Or from source:
pip install -e .
Quick start
from traceact import traced_action, configure, TraceConfig, JsonlSink
configure(
config=TraceConfig(sink_mode="blocking"),
sinks=[JsonlSink("data/traces.jsonl")],
)
@traced_action(action="note.create", kind="app", actor="user")
def create_note(title, body):
...
Manual tracing
from traceact import ActionTrace
with ActionTrace.start(action="note.create", kind="app") as trace:
trace.input({"title": "Hello"})
trace.step("Validated input")
trace.event(kind="db", operation="insert", target="notes")
trace.output({"note_id": "note_123"})
Concepts
| Concept | Meaning |
|---|---|
Trace |
The full story of one action |
Step |
A human-readable timeline marker |
Event |
A structured operation (db, http, file, model, etc.) |
Touch |
A resource involved in the trace |
Sink |
Where the trace is written |
Requirements
Python 3.9+. No runtime dependencies.
License
MIT
Built by Mo Shehu.
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 traceact-0.1.1.tar.gz.
File metadata
- Download URL: traceact-0.1.1.tar.gz
- Upload date:
- Size: 35.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
490b5246a77b93c36256ffdde6994cca528ba2af2b5a12c377c16732deb417a9
|
|
| MD5 |
3c293bb055b82c0596769fcb32e54cea
|
|
| BLAKE2b-256 |
f6fdfd940a190ba6627be2b44d434d025255989f730983422acf526a1e4f5787
|
Provenance
The following attestation bundles were made for traceact-0.1.1.tar.gz:
Publisher:
publish.yml on traceact/traceact
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
traceact-0.1.1.tar.gz -
Subject digest:
490b5246a77b93c36256ffdde6994cca528ba2af2b5a12c377c16732deb417a9 - Sigstore transparency entry: 2208683105
- Sigstore integration time:
-
Permalink:
traceact/traceact@f012686584955488d8e4702bcf4bb73f2aefaee7 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/traceact
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f012686584955488d8e4702bcf4bb73f2aefaee7 -
Trigger Event:
release
-
Statement type:
File details
Details for the file traceact-0.1.1-py3-none-any.whl.
File metadata
- Download URL: traceact-0.1.1-py3-none-any.whl
- Upload date:
- Size: 33.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f48bcfb6041beafaa5526556bd094aa2fe0f25566966b40d4cf869e6c302525
|
|
| MD5 |
b18a543b5ab225c5cc750d43bd4079ec
|
|
| BLAKE2b-256 |
456483167b47249908d2e62f98834f6d47bada9be69a3ecb303004adade578af
|
Provenance
The following attestation bundles were made for traceact-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on traceact/traceact
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
traceact-0.1.1-py3-none-any.whl -
Subject digest:
2f48bcfb6041beafaa5526556bd094aa2fe0f25566966b40d4cf869e6c302525 - Sigstore transparency entry: 2208683156
- Sigstore integration time:
-
Permalink:
traceact/traceact@f012686584955488d8e4702bcf4bb73f2aefaee7 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/traceact
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f012686584955488d8e4702bcf4bb73f2aefaee7 -
Trigger Event:
release
-
Statement type: