Metadata-Version: 2.4
Name: tracemorph
Version: 0.1.5
Summary: Function execution tracing, visualization, and narrative builder for Python apps.
Home-page: https://github.com/lahadiyani/tracemorph
Author: Hadi
Author-email: Hadi <lahadiyani@gmail.com>
License: Custom NonCommercial License
Project-URL: Homepage, https://github.com/lahadiyani/tracemorph
Project-URL: Source, https://github.com/lahadiyani/tracemorph
Project-URL: Tracker, https://github.com/lahadiyani/tracemorph/issues
Keywords: tracing,execution,debug,visualization,narrative,python
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: License :: Other/Proprietary License
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Debuggers
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests
Requires-Dist: flask
Requires-Dist: colorama
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# TraceMorph

![image](tracemorph/static/icon.jpg)

**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

pip install tracemorph

```

### 🧠 Contoh Penggunaan

```python
from tracemorph import trace

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

bagi(10, 2)
```

### contoh 2

```python

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

```python

from tracemorph import trace, TraceBuilder

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

test(10)

print(TraceBuilder.build_narrative_for_last()[0])

```
