Skip to main content

A python toolkit to evaluate, validate, and debug Azure Data Factory & Microsoft Fabric pipeline expressions with rich tracing.

Project description

fabrix

Evaluate expressions without the need of pipelines.

Package version Supported Python versions

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

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

fabrix-0.5.1.tar.gz (21.2 kB view details)

Uploaded Source

Built Distribution

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

fabrix-0.5.1-py3-none-any.whl (24.5 kB view details)

Uploaded Python 3

File details

Details for the file fabrix-0.5.1.tar.gz.

File metadata

  • Download URL: fabrix-0.5.1.tar.gz
  • Upload date:
  • Size: 21.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for fabrix-0.5.1.tar.gz
Algorithm Hash digest
SHA256 00b6e43b88a1028dbc631241295cba732eba10ab09e1dbd4242484c0b87b2351
MD5 9c1e1a12e980877b743dd7caff6fcd78
BLAKE2b-256 1d775677962a0d0c4b77ad65baaa96e1f7956f4b5dffbfa45870860f4c12e3a9

See more details on using hashes here.

Provenance

The following attestation bundles were made for fabrix-0.5.1.tar.gz:

Publisher: publish.yml on Luanee/fabrix

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fabrix-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: fabrix-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 24.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for fabrix-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1a48c5b4824d2af65832d60ff3418bc5c125bbc5d66fcf75be1e8d24bfc80fc7
MD5 a6c88005e99550c75b7ddf78924aa1a6
BLAKE2b-256 7cb5be6334af0040d76c339b1b262afec10f0cea61f9bbb8da42ad439ac90470

See more details on using hashes here.

Provenance

The following attestation bundles were made for fabrix-0.5.1-py3-none-any.whl:

Publisher: publish.yml on Luanee/fabrix

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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