Skip to main content

Metadata-driven execution engine for Fabric/Spark data pipelines.

Project description

weevr

Configuration-driven data shaping for Spark in Microsoft Fabric.

weevr lets you declare data transformation intent in YAML and execute it on PySpark. Define what should happen to your data — sources, transforms, joins, validations, write behavior — and let a stable engine handle how it runs. No code generation, no abstraction leaks. Just Spark DataFrame operations driven by configuration.

Installation

pip install weevr

Quick Start

Define a thread — the smallest unit of work — using a .thread file:

# dim_customer.thread
config_version: "1.0"
sources:
  raw_customers:
    type: delta
    path: "${lakehouse_path}/raw/customers"
steps:
  - filter:
      expr: "is_active = true"
  - select:
      columns: [customer_id, name, email, region]
target:
  path: "${lakehouse_path}/curated/dim_customer"
write:
  mode: overwrite

Run it from a Fabric Notebook or any PySpark environment:

from weevr import Context

ctx = Context(spark, "my-project.weevr")
result = ctx.run("dim_customer.thread")
print(result.status)  # "success"

Features

  • Declarative transforms — Filter, join, dedup, sort, rename, cast, derive, select, drop, aggregate, window, pivot, and union — all expressed in YAML
  • Flexible write modes — Overwrite, append, and merge (upsert) with configurable match, update, and delete behavior
  • Validation and data quality — Pre-write rules with severity routing (info, warn, error, fatal) and automatic row quarantine; post-write assertions for row counts, null checks, uniqueness, and custom expressions
  • DAG orchestration — Automatic dependency resolution, parallel thread execution within weaves, sequential weave ordering, configurable failure behavior, and auto-cache management
  • Configuration inheritance — Define patterns once at loom or weave level, cascade to threads with child-wins semantics
  • Variable injection — Environment-agnostic configs with parameter files and runtime overrides
  • Incremental processing — Watermark-based incremental loads, CDC merge routing with hard/soft delete support, and Delta Change Data Feed integration
  • Observability — OTel-compatible execution spans, structured JSON logging, row count reconciliation, and execution trace trees
  • Null-safe defaults — Opinionated join semantics and key handling that prevent common Spark pitfalls
  • Python APIContext class with run() for execution, load() for config inspection, and verification modes for dry-run validation

Core Abstractions

weevr organizes work through four concepts:

  • Thread — The smallest executable unit. Reads from one or more sources, applies transforms, validates, and writes to a single target.
  • Weave — A collection of threads forming a dependency DAG. Represents a subject area or processing stage. Independent threads run in parallel.
  • Loom — A deployable unit packaging one or more weaves with defined execution order. The primary unit of versioning and release.
  • Project — A logical grouping of looms. Defines the boundary for shared configuration, parameter files, helpers, and UDFs.

Core Principles

  • Declarative intent, imperative execution — Configuration is read at runtime and drives execution directly. No code generation from YAML.
  • Spark-native, Fabric-aligned — All execution uses Spark DataFrame APIs inside Fabric's runtime. No external systems or runtimes.
  • Deterministic and idempotent — Same configuration and inputs produce consistent behavior. Safe to rerun.
  • Opinionated defaults, configurable overrides — Safe defaults for null handling, join behavior, and failure semantics. Override when you need to.
  • Configuration reuse through inheritance — Define patterns once at higher levels and inherit down. Reduces effort, enforces standards.

Non-goals

weevr is intentionally not:

  • A low-code or no-code platform
  • A visual workflow designer
  • A replacement for Spark or re-implementation of data processing primitives
  • An abstraction layer that hides the underlying execution engine

The goal is to reduce orchestration friction and enforce repeatable patterns — not to obscure how data is processed.

Target Audience

  • Analysts who know SQL but not Spark
  • Data engineers who want config-driven consistency
  • Teams building medallion architectures in Fabric
  • Anyone seeking repeatable, governed data transformation patterns

Deployment Model

weevr's engine is a general-purpose library distributed via PyPI. It contains no project-specific configuration.

Integration projects are separate repositories containing YAML configs, Fabric Notebooks, and any project-specific UDFs or helpers. This separation lets the engine evolve independently while teams own their configuration.

Compatibility

Component Version
Python 3.11
PySpark 3.5
Delta Lake 3.2
Microsoft Fabric Runtime 1.3

CLI

weevr-cli is a standalone command-line companion for validating configs, inspecting schemas, and running dry-run operations outside of a notebook. Install it separately:

pip install weevr-cli

Full CLI documentation: ardent-data.github.io/weevr-cli

What's Next

  • Extensibility — Reusable stitch patterns, project-level UDF and helper registries
  • Advanced merge patterns — Insert-only mode, complex update strategies

Documentation

Full documentation is available at ardent-data.github.io/weevr.

Contributing

See CONTRIBUTING.md for development setup, workflow expectations, and pull request conventions. Contributions are welcome.

License

Apache License 2.0. See LICENSE for details.

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

weevr-1.13.0.tar.gz (198.8 kB view details)

Uploaded Source

Built Distribution

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

weevr-1.13.0-py3-none-any.whl (245.4 kB view details)

Uploaded Python 3

File details

Details for the file weevr-1.13.0.tar.gz.

File metadata

  • Download URL: weevr-1.13.0.tar.gz
  • Upload date:
  • Size: 198.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for weevr-1.13.0.tar.gz
Algorithm Hash digest
SHA256 3fd2397a138fbf658fe3c23f8bf477ab988c7c573047c03392087846a9013cf3
MD5 3e73a18367115deeaef323b079f40a3d
BLAKE2b-256 a75088466c89245f6c5dda39d57e7c9362d9d9b24a5a5ab2768e02fe73e940cc

See more details on using hashes here.

File details

Details for the file weevr-1.13.0-py3-none-any.whl.

File metadata

  • Download URL: weevr-1.13.0-py3-none-any.whl
  • Upload date:
  • Size: 245.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for weevr-1.13.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9c72b1ebd960ffbdde319e3a94eebbd58fd2695536dd37d3861eb9dc022760ee
MD5 24f6541570882464864cf2807b87c3b1
BLAKE2b-256 d64e4fbf81e93b077b1d940407c59dc167267d3631dd121111dda78c2d0dfbed

See more details on using hashes here.

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