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
- 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])
Project details
Release history Release notifications | RSS feed
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.5.tar.gz
(4.4 MB
view details)
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 tracemorph-0.1.5.tar.gz.
File metadata
- Download URL: tracemorph-0.1.5.tar.gz
- Upload date:
- Size: 4.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
87039610c94d823d5eaf3db71a896080d51715d788d5da816b7ef10edf97f741
|
|
| MD5 |
b3c0529d762bb5763877817a021bbe17
|
|
| BLAKE2b-256 |
29f51cc5450c1283b78376d15f23ba37a1b163b864d3e08269decd518f067635
|
File details
Details for the file tracemorph-0.1.5-py3-none-any.whl.
File metadata
- Download URL: tracemorph-0.1.5-py3-none-any.whl
- Upload date:
- Size: 5.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
492d1c13286a6dba4424aca66e40cef06d109693109ed5ea4bd29ac4a2308645
|
|
| MD5 |
b5e946bec19741ccbe007fcf6621489e
|
|
| BLAKE2b-256 |
d2653ecf766a744fbfd2fb9f6ffc75f2866e681e8ced161d59e4f8cd44b69591
|