Framework for defining, validating, and evolving tables in a consistent, safe, and controlled way.
Project description
delta-engine
Declarative schema management for Delta Lake tables on Databricks. You declare the state a table should have; the engine reads the state it actually has, computes the difference, checks that the difference is safe to apply, and runs exactly the DDL needed to close the gap.
There is no migration script to write and no DDL to hand-order. The declaration
is the source of truth, and every sync reconciles the catalog to it.
Backends: delta-engine targets Delta Lake on Databricks with Unity Catalog today. The planning core is deliberately backend-free — backends plug in as adapters that read catalog state and execute plans — so other backends, such as open-source Unity Catalog, can be added without changing the model.
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 a Databricks
environment, which provides Spark and Delta. See the
installation guide
for the [databricks] extra used for local development.
Quickstart
from delta_engine.databricks import build_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_engine(spark) # `spark` is provided by your Databricks notebook
engine.sync(customers) # creates the table, or no-ops if it already matches
What a sync does
Every sync runs the same phase chain for each table: read the current catalog
state, diff it against your declaration, validate that the drift is safe to fix
in place, plan deterministic DDL, order tables so foreign-key dependencies are
created first, execute, and return a per-table SyncReport. Unsafe changes —
dropping data, changing a column's type, repartitioning — fail validation with
a named rule before any SQL runs.
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
- Handle sync failures — inspect
SyncReportand act on each status
Reference
- 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
- 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.3.0.tar.gz.
File metadata
- Download URL: delta_engine-0.3.0.tar.gz
- Upload date:
- Size: 278.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
226a320a46913cc178aae3de8749496a76c262120682ca44c86584c65e7689c4
|
|
| MD5 |
e1dd42a1d8ff1b086f13cf934bfde744
|
|
| BLAKE2b-256 |
65917b950891e8dae8876084025d52d581f1f5da33e834cffd7f3b4b75ec9007
|
Provenance
The following attestation bundles were made for delta_engine-0.3.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.3.0.tar.gz -
Subject digest:
226a320a46913cc178aae3de8749496a76c262120682ca44c86584c65e7689c4 - Sigstore transparency entry: 2137029702
- Sigstore integration time:
-
Permalink:
Tomoscorbin/delta-engine@b35c9f8ebec8b363766f4baa4f41941ea56c0c3a -
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@b35c9f8ebec8b363766f4baa4f41941ea56c0c3a -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file delta_engine-0.3.0-py3-none-any.whl.
File metadata
- Download URL: delta_engine-0.3.0-py3-none-any.whl
- Upload date:
- Size: 80.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74d980a18002991dcec348cef0408e475a9cb8a0699a8b093610eacb4baa2d49
|
|
| MD5 |
41f9f66971a53e2a64216dffe8640c3d
|
|
| BLAKE2b-256 |
158613fd2f43e8791d381a80a22381eb0f4f6323f2b6a088942f676303aaf0f2
|
Provenance
The following attestation bundles were made for delta_engine-0.3.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.3.0-py3-none-any.whl -
Subject digest:
74d980a18002991dcec348cef0408e475a9cb8a0699a8b093610eacb4baa2d49 - Sigstore transparency entry: 2137029712
- Sigstore integration time:
-
Permalink:
Tomoscorbin/delta-engine@b35c9f8ebec8b363766f4baa4f41941ea56c0c3a -
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@b35c9f8ebec8b363766f4baa4f41941ea56c0c3a -
Trigger Event:
workflow_dispatch
-
Statement type: