Skip to content
/ fabrix Public

fabrix - a Python toolkit to evaluate, validate, and debug Azure Data Factory & Microsoft Fabric pipeline expressions with rich tracing.

License

Notifications You must be signed in to change notification settings

Luanee/fabrix

Repository files navigation

fabrix

Evaluate expressions without the need of pipelines.

Package version Supported Python versions Codecov

fabrix is a Python toolkit to evaluate, validate, and debug Microsoft Fabric / Azure Data Factory 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.


Documentation: https://github.com/luanee/fabrix/wiki Source Code: https://github.com/luanee/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

  • pydantic for smaller validations
  • rich for beautiful output

⚙️ Installation

pip install fabrix

🚀 Usage

from fabrix import Context, Expression, evaluate, run

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

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

# With variable assignment
expr_1 = Expression(expression="@toUpper(variables('greeting'))", variable="shout")
expr_2 = Expression(expression="@add(variables('row_index'),mul(4,5),add(variables('row_index'),max(4.5,3.9,578.4)))")

run(expr_1, expr_2, context=ctx, show_output=True)  # see output below
print(ctx.variables["shout"])  # HELLO

expression console output

🗺️ 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

About

fabrix - a Python toolkit to evaluate, validate, and debug Azure Data Factory & Microsoft Fabric pipeline expressions with rich tracing.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages