Skip to main content

TraceMorph

image

TraceMorph adalah library Python untuk melacak eksekusi fungsi, membangun visualisasi call-chain, serta menghasilkan narasi error berbasis AI (via LLM API).

🚀 Fitur

  • Dekorator tracing fungsi otomatis
  • Pelacakan exception global
  • Ekspor hasil trace ke JSON
  • Narasi human-readable berbasis LLM
  • Bisa diintegrasikan ke middleware, testing, atau backend

Cara install

pip install tracemorph

🧠 Contoh Penggunaan

from tracemorph import trace

@trace
def bagi(a, b):
    return a / b

bagi(10, 2)

contoh 2

from tracemorph import trace, TraceBuilder

@trace()
def error_prone(x, y):
    return x / y  # Bisa error kalau y=0

if __name__ == "__main__":
    try:
        error_prone(10, 0)
    except Exception:
        pass

    data = TraceBuilder.build_latest_and_export()

    if data:
        print(data['colored_narrative'])  # Print narasi berwarna rapi di terminal
    else:
        print("No trace found.")

contoh 3

from tracemorph import trace, TraceBuilder

@trace
def test(x):
    return x * 2

test(10)

print(TraceBuilder.build_narrative_for_last()[0])

Metadata

Release files for tracemorph 0.1.5

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

Source distribution (sdist)

Source distribution for tracemorph 0.1.5
File Size Uploaded
tracemorph-0.1.5.tar.gz 4.4 MB Details

Built distribution (wheel)

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

Total release size: 9.7 MB

Release files / tracemorph-0.1.5.tar.gz

Download URL tracemorph-0.1.5.tar.gz
Size 4.4 MB
Tags Source
SHA-256 checksum
How to use checksums
87039610c94d823d5eaf3db71a896080d51715d788d5da816b7ef10edf97f741
BLAKE2b-256 checksum
How to use checksums
29f51cc5450c1283b78376d15f23ba37a1b163b864d3e08269decd518f067635
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.6

Release files / tracemorph-0.1.5-py3-none-any.whl

Download URL tracemorph-0.1.5-py3-none-any.whl
Size 5.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
492d1c13286a6dba4424aca66e40cef06d109693109ed5ea4bd29ac4a2308645
BLAKE2b-256 checksum
How to use checksums
d2653ecf766a744fbfd2fb9f6ffc75f2866e681e8ced161d59e4f8cd44b69591
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.6

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

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