Metadata-Version: 2.3
Name: fabrix
Version: 0.2.0
Summary: A python toolkit to evaluate, validate, and debug Azure Data Factory & Microsoft Fabric pipeline expressions with rich tracing.
License: MIT
Author: Pit Nahrstedt
Author-email: pit.nahrstedt@outlook.de
Requires-Python: >=3.11,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: pydantic (>=2.11.7,<3.0.0)
Requires-Dist: python-dateutil (>=2.9.0.post0,<3.0.0)
Requires-Dist: pytz (>=2025.2,<2026.0)
Requires-Dist: rich (>=14.1.0,<15.0.0)
Description-Content-Type: text/markdown

# 🧵 fabrix

**fabrix** is a Python toolkit to **evaluate, validate, and debug**
[Microsoft Fabric / Azure Data Factory](https://learn.microsoft.com/en-us/fabric/data-factory/expression-language) pipeline expressions.
It helps you test expressions locally, manage variables & parameters, and visualize execution with **rich tracing**.

> ⚠️ This project is still in progress. Expect changes and new features soon.

---

## 🔗 Links
- 📖 [Documentation (WIP)](https://github.com/yourname/fabrix/wiki)
- 💻 [Source Code](https://github.com/yourname/fabrix)

---

## ✨ Features
- Parse & evaluate Fabric/ADF expressions locally
- Manage **variables**, **pipeline parameters**, and **scope values**
- Validate syntax: unmatched brackets, wrong quotes, unknown functions
- Debug with **beautiful Rich tree traces**
- Extend with your own custom functions via a registry

---

## 📦 Requirements
- Python **3.11+**
- [pydantic](https://docs.pydantic.dev) v2
- [rich](https://rich.readthedocs.io/)

---

## ⚙️ Installation
```bash
pip install fabrix
```

## 🚀 Usage

```python
from fabrix import Context, evaluate

# Create a context with parameters & variables
ctx = Context(
    pipeline_parameters={"myNumber": 42},
    variables={"greeting": "hello"}
)

# Simple expression
result = evaluate("@concat('Answer is: ', string(pipeline().parameters.myNumber))", ctx)
print(result)  # Answer is: 42

# With variable assignment
from fabrix import Expression

expr = Expression(expression="@toUpper(variables('greeting'))", result="shout")
evaluate(expr, context=ctx)

print(ctx.variables["shout"])  # HELLO

```

## 🗺️ Roadmap

- [ ] Add more Fabric/ADF built-in functions
- [ ] Improve error messages with fuzzy suggestions
- [ ] Advanced type checking for function arguments
- [ ] VS Code extension with syntax highlighting & validation
- [ ] Better documentation and tutorials
- [ ] Publish first stable release on PyPI

