Core SQL pipeline framework — joints, engines, catalogs
Project description
Rivet is a framework that revolutionizes data pipelines by strictly separating concerns. It allows you to define your pipeline once and run it on DuckDB, Polars, PySpark, Postgres or any other engine without changing your logic.
🧠 The Mental Model
Rivet pipelines are built on three foundational pillars:
| Concept | Rivet Abstraction | Description |
|---|---|---|
| What to compute | Joints | Named, declarative units of computation (SQL, Python, Source, Sink). |
| How to compute | Engines | Deterministic compute engines that execute the logic. |
| Where data lives | Catalogs | Named references to data locations like filesystems, databases, or object stores. |
This architecture lets you build portable pipelines. Adjacent SQL joints assigned to the same engine are automatically fused into a single query to reduce memory pressure and avoid unnecessary data movement.
✨ Key Features
- 🔄 Multi-Engine Execution: Swap compute engines without rewriting pipelines.
- 🛠️ Declarative Flexibility: Define joints using SQL, YAML, or Python.
- 🛡️ Ironclad Data Quality: * Assertions run pre-write on computed data to catch errors before they hit your target.
- Audits run post-write by reading back from the target catalog to verify state.
- 🧪 Built-in Offline Testing: Validate your transformation logic using offline fixture data without needing a live database.
- 💻 Interactive REPL: Use
rivet replfor a full-screen terminal UI to explore data, run ad-hoc queries, and iterate on pipeline logic. - 🔀 Advanced Write Strategies: Supports 7 write modes including
append,replace,merge, andscd2(Slowly Changing Dimensions).
⚡ Quick Start
1. Install
Install Rivet with all plugins:
pip install 'rivetsql[all]'
Or install only what you need:
pip install 'rivetsql[duckdb]' # recommended for local dev
2. Initialize a Project
Scaffold a new project with the required directory structure:
rivet init my_pipeline
cd my_pipeline
3. Run the Pipeline
Compile and execute your DAG:
rivet run
💡 Example: A Complete Pipeline
Three files. Source → Transform → Sink. That's it.
1. Read raw data from a catalog:
-- sources/raw_orders.sql
-- rivet:name: raw_orders
-- rivet:type: source
-- rivet:catalog: local
-- rivet:table: raw_orders
select * from raw_orders
2. Transform with plain SQL:
-- joints/daily_revenue.sql
-- rivet:name: daily_revenue
-- rivet:type: sql
SELECT
order_date,
SUM(amount) AS revenue
FROM raw_orders
WHERE status = 'completed'
GROUP BY order_date
3. Write results with quality checks:
-- sinks/daily_revenue_out.sql
-- rivet:name: daily_revenue_out
-- rivet:type: sink
-- rivet:upstream: [daily_revenue]
-- rivet:catalog: warehouse
-- rivet:table: daily_revenue
-- rivet:write_strategy: replace
-- rivet:assert: not_null(revenue)
-- rivet:assert: row_count(min=1)
$ rivet run
✓ compiled 3 joints in 38ms
raw_orders ✓ OK (1200 rows)
daily_revenue ✓ OK (90 rows)
daily_revenue_out ✓ OK (90 rows)
38ms | 3 joints | 1 groups | 0 failures
If an assertion like not_null fails, the write is completely aborted, keeping your target clean.
🧩 Rich Plugin Ecosystem
Rivet is fully extensible through plugins.
| Package | Engine Type | Catalog Type | Best For |
|---|---|---|---|
rivet-duckdb |
duckdb |
duckdb |
Local analytics and fast SQL on files. |
rivet-polars |
polars |
— | In-process DataFrame transforms. |
rivet-pyspark |
pyspark |
— | Large-scale distributed processing. |
rivet-postgres |
postgres |
postgres |
PostgreSQL databases as sources and sinks. |
rivet-aws |
— | s3, glue |
AWS S3 object storage and Glue Data Catalog. |
rivet-databricks |
databricks |
unity, databricks |
Databricks SQL warehouses and Unity Catalog. |
📚 Documentation
Start here:
🤝 Contributing
Pull requests are welcome! Check out our Contribution Guidelines.
git clone https://github.com/rivetsql/rivetsql
Built for data engineers who love SQL, demand quality, and value flexibility.
Project details
Release history Release notifications | RSS feed
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 rivetsql-0.1.18.tar.gz.
File metadata
- Download URL: rivetsql-0.1.18.tar.gz
- Upload date:
- Size: 803.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2e53e1afe14324bcd478c643a730d07e2374e5c7e9fea5f9f518fa810066d5a
|
|
| MD5 |
538e8541051a284d3ae14ad8a304f267
|
|
| BLAKE2b-256 |
e8281a02a1ae1ea94c0bdfea9a0bab8a3c2104985672ee18afa72ceafaaac959
|
Provenance
The following attestation bundles were made for rivetsql-0.1.18.tar.gz:
Publisher:
publish.yml on rivetsql/rivetsql
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rivetsql-0.1.18.tar.gz -
Subject digest:
b2e53e1afe14324bcd478c643a730d07e2374e5c7e9fea5f9f518fa810066d5a - Sigstore transparency entry: 1642596584
- Sigstore integration time:
-
Permalink:
rivetsql/rivetsql@a3cbd6268b959bd0ed0946ff56fbdf43f84f1d27 -
Branch / Tag:
refs/tags/v0.1.18 - Owner: https://github.com/rivetsql
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a3cbd6268b959bd0ed0946ff56fbdf43f84f1d27 -
Trigger Event:
release
-
Statement type:
File details
Details for the file rivetsql-0.1.18-py3-none-any.whl.
File metadata
- Download URL: rivetsql-0.1.18-py3-none-any.whl
- Upload date:
- Size: 445.8 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 |
07ef6ff00eea7e6483131db6e4fb7326b16152ead46a840c110ffc4f58ac7949
|
|
| MD5 |
c8f29119518248745edcc3d33f7a049a
|
|
| BLAKE2b-256 |
2de7e5ec055c4610a66716d5d6515ded9e4d4be614487f7f6687c23785204714
|
Provenance
The following attestation bundles were made for rivetsql-0.1.18-py3-none-any.whl:
Publisher:
publish.yml on rivetsql/rivetsql
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rivetsql-0.1.18-py3-none-any.whl -
Subject digest:
07ef6ff00eea7e6483131db6e4fb7326b16152ead46a840c110ffc4f58ac7949 - Sigstore transparency entry: 1642596817
- Sigstore integration time:
-
Permalink:
rivetsql/rivetsql@a3cbd6268b959bd0ed0946ff56fbdf43f84f1d27 -
Branch / Tag:
refs/tags/v0.1.18 - Owner: https://github.com/rivetsql
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a3cbd6268b959bd0ed0946ff56fbdf43f84f1d27 -
Trigger Event:
release
-
Statement type: