Framework for defining, validating, and evolving tables in a consistent, safe, and controlled way.
Project description
delta-engine
Declarative, safety-first schema and metadata management for Delta Lake tables on Databricks.
Define the state your tables should have in Python. Delta Engine reads their current Unity Catalog state, calculates the difference, validates whether each change is safe, and executes only the DDL needed to reconcile them.
There are no migration scripts to maintain and no DDL statements to hand-order. Your declarations remain the source of truth across the lifetime of the table.
What Delta Engine gives you
- Desired-state reconciliation: declare the complete table state rather than a sequence of migrations.
- Safe in-place evolution: unsafe changes, such as type narrowing, repartitioning or destructive schema changes, are rejected before any SQL runs.
- Reviewable plans: preview semantic changes and compiled DDL with a dry run before applying them.
- Drift detection: compare version-controlled declarations against the live Unity Catalog state in local workflows or CI.
- Scoped ownership: manage governance metadata without taking ownership of a table’s schema or data lifecycle.
- Dependency-aware execution: synchronise groups of tables in the correct order when primary-key and foreign-key relationships exist.
Delta Engine does not need to own how a table’s data is produced. It can manage the catalog state around tables populated by PySpark jobs, declarative pipelines, dbt models or other systems.
Install
pip install delta-engine
The base package is pure Python with no runtime dependencies: declaring and
planning schemas needs no PySpark. Running a sync needs either a Spark
session or a Databricks SQL warehouse connection. Inside a Databricks
notebook, Spark is already provided; elsewhere, install the [spark] extra
for local development against a Spark session, or the [sql] extra to sync
through a SQL warehouse instead — schema sync from CI without a Spark session
or cluster. See the
installation guide
for both extras and their requirements.
Install delta-engine[cli] to run
delta-engine plan MODULE:ATTRIBUTE through any standard Databricks
unified-auth configuration. The CLI always shows the semantic diff, report,
and planned SQL and never applies the generated plan. See the
CLI reference.
Quickstart
from delta_engine.databricks import build_spark_engine
from delta_engine.schema import Column, DeltaTable, Integer, String
customers = DeltaTable(
catalog="dev",
schema="silver",
name="customers",
columns=[
Column("id", Integer(), nullable=False),
Column("name", String()),
],
)
engine = build_spark_engine(spark) # `spark` is provided by your Databricks notebook
engine.sync(customers) # creates the table, or no-ops if it already matches
Every sync follows the same process:
read live state
→ compare with the declaration
→ validate the differences
→ build a deterministic plan
→ resolve table dependencies
→ execute
Validation happens before execution. When a table contains an unsafe change, Delta Engine does not execute a partially valid plan for that table.
Documentation
Start with how a sync works for the model, or jump to what you need:
Getting started
- Installation
- Getting started tutorial — define a table and run your first sync
Concepts
- How a sync works — the phases between calling
syncand getting a report - The safety model — what the engine blocks, and why
How-to guides
- Configure a table — properties, tags, comments, keys, and partitioning
- Deploy metadata only — roll out governance metadata with no schema change
- Preview changes with a dry run
- Gate schema changes in CI — report planned changes and fail unreadable or unsafe plans
- Handle sync failures — inspect
SyncReportand act on each status
Reference
- CLI — the read-only plan command, connection contract, output, and exit codes
- Capabilities and limitations — what the engine can and cannot manage
- Data types — supported types and Spark SQL equivalents
- Safe-change rules — changes the engine blocks at validation
- Run report schema — the
to_dict()payload, field by field - API reference
Architecture
- Architecture — layers, ports and adapters, design decisions
- Implement a custom adapter — the
CatalogStateReaderandPlanExecutorports - Add a new action type — extend
Action,ActionPhase, and the compiler
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file delta_engine-0.5.0.tar.gz.
File metadata
- Download URL: delta_engine-0.5.0.tar.gz
- Upload date:
- Size: 460.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26cd6bc0e77d621b09ef6ef26b677ee03e6fe2fee537252dcc35a316ac0e92f5
|
|
| MD5 |
01e100d30a288b40cd8f9bf965646a21
|
|
| BLAKE2b-256 |
ab7b71601834a97e40a882ace5e37756f79233cf157ef1e1fcc8c6ecae34648c
|
Provenance
The following attestation bundles were made for delta_engine-0.5.0.tar.gz:
Publisher:
release.yaml on Tomoscorbin/delta-engine
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
delta_engine-0.5.0.tar.gz -
Subject digest:
26cd6bc0e77d621b09ef6ef26b677ee03e6fe2fee537252dcc35a316ac0e92f5 - Sigstore transparency entry: 2205498168
- Sigstore integration time:
-
Permalink:
Tomoscorbin/delta-engine@406a51243e02b30bf457e7fa2c4bea0add2853d5 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Tomoscorbin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@406a51243e02b30bf457e7fa2c4bea0add2853d5 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file delta_engine-0.5.0-py3-none-any.whl.
File metadata
- Download URL: delta_engine-0.5.0-py3-none-any.whl
- Upload date:
- Size: 107.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
04ea5b9f0998be64eabb6d308b694cad3ea1c18068468830fd5c4249ed7bb8f2
|
|
| MD5 |
987e8228b22c6eb0677a094b5889f152
|
|
| BLAKE2b-256 |
4f9cb37c49495fed41357bc1f8af6b981f4bc1c99d3f4ef3b1ac872178547088
|
Provenance
The following attestation bundles were made for delta_engine-0.5.0-py3-none-any.whl:
Publisher:
release.yaml on Tomoscorbin/delta-engine
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
delta_engine-0.5.0-py3-none-any.whl -
Subject digest:
04ea5b9f0998be64eabb6d308b694cad3ea1c18068468830fd5c4249ed7bb8f2 - Sigstore transparency entry: 2205498177
- Sigstore integration time:
-
Permalink:
Tomoscorbin/delta-engine@406a51243e02b30bf457e7fa2c4bea0add2853d5 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Tomoscorbin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@406a51243e02b30bf457e7fa2c4bea0add2853d5 -
Trigger Event:
workflow_dispatch
-
Statement type: