Skip to main content

Function execution tracing, visualization, and narrative builder for Python apps.

Project description

TraceMorph

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
  • Visualisasi call-stack dan dependensi fungsi
  • Ekspor hasil trace ke JSON
  • Narasi human-readable berbasis LLM prompt engineering
  • Bisa diintegrasikan ke middleware, testing, atau backend

🧠 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])

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tracemorph-0.1.4.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

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

tracemorph-0.1.4-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file tracemorph-0.1.4.tar.gz.

File metadata

  • Download URL: tracemorph-0.1.4.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.6

File hashes

Hashes for tracemorph-0.1.4.tar.gz
Algorithm Hash digest
SHA256 87b4254db8892a67cacfa7327c2f91f56762be795a23e0202c98a08b69d5ac49
MD5 b03753f1559fb2c856ff14dd2f57ccf9
BLAKE2b-256 45b62787a72d37350c580f832139e40190bad1654574c87230bcf99696b0ebc0

See more details on using hashes here.

File details

Details for the file tracemorph-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: tracemorph-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.6

File hashes

Hashes for tracemorph-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 49f71702f5961ee7f521e766a8a204c87a5504572f0d31dc15057edcc9371c5a
MD5 0e5c52f04ebd4b496e327cf307af6eee
BLAKE2b-256 113ee8ba13208b1217a74cf7a920737c37bc7b65f837fd17a8711a8e83326985

See more details on using hashes here.

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