Skip to main content

TraceAct

PyPI version Python versions License: MIT

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

traceact-0.1.1.tar.gz (35.7 kB view details)

Uploaded Source

Built Distribution

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

traceact-0.1.1-py3-none-any.whl (33.0 kB view details)

Uploaded Python 3

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

Hashes for traceact-0.1.1.tar.gz
Algorithm Hash digest
SHA256 490b5246a77b93c36256ffdde6994cca528ba2af2b5a12c377c16732deb417a9
MD5 3c293bb055b82c0596769fcb32e54cea
BLAKE2b-256 f6fdfd940a190ba6627be2b44d434d025255989f730983422acf526a1e4f5787

See more details on using hashes here.

Provenance

The following attestation bundles were made for traceact-0.1.1.tar.gz:

Publisher: publish.yml on traceact/traceact

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

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

Hashes for traceact-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2f48bcfb6041beafaa5526556bd094aa2fe0f25566966b40d4cf869e6c302525
MD5 b18a543b5ab225c5cc750d43bd4079ec
BLAKE2b-256 456483167b47249908d2e62f98834f6d47bada9be69a3ecb303004adade578af

See more details on using hashes here.

Provenance

The following attestation bundles were made for traceact-0.1.1-py3-none-any.whl:

Publisher: publish.yml on traceact/traceact

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page