Python SDK to interact with DuckLake.
Project description
ducklake-sdk — Native SDKs for DuckLake
Read and write DuckLake tables from Rust and Python - no DuckDB required.
DuckLake is an integrated data lake and catalog format that stores metadata in a SQL catalog database and writes data as Parquet files. This repository provides standalone Rust and Python SDKs that talk to DuckLakes directly, with no dependency on DuckDB or its DuckLake extension.
All language SDKs are built on the same Rust core, which bundles the implementation of the DuckLake specification.
Python (ducklake-sdk)
Rust (ducklake)
[!WARNING] This is not an official SDK released by the DuckDB Foundation.
Getting Started
Python
pip install ducklake-sdk # core
pip install "ducklake-sdk[polars]" # Polars integration
pip install "ducklake-sdk[arrow]" # Arrow + DuckDB integration
Rust
cargo add ducklake
Quick Example
import ducklake as dl
import polars as pl
# Create a new DuckLake backed by SQLite metadata and local Parquet storage
ducklake = dl.create("sqlite:///metadata.sqlite", data_path="data_files/")
# Define a table.
table = ducklake.create_table(
"events",
schema={"id": dl.Int64(), "message": dl.Varchar()},
)
# Write data using Polars
lf = pl.LazyFrame({"id": [1, 2, 3], "message": ["hello", "ducklake", "sdk"]})
table.sink_polars(lf)
# Read it back as a Polars LazyFrame
df = table.scan_polars().collect()
For the full API, see the Python documentation or the Rust API docs.
Features
The Rust core — and therefore every SDK built on top of it — supports:
- Metadata operations — schemas, tables, schema evolution, partitioning, constraints, and table/column tags
- Transactions with conflict resolution
- Data inlining for small writes
- Metadata configuration
- Time travel queries
The Python SDK additionally provides:
- Reading and writing data through Polars
- Reading, writing, and deleting data through DuckDB
- Maintenance operations — compaction, snapshot expiration, and more — via DuckDB
Compatibility Matrix
Catalog Databases
| Database | Status |
|---|---|
| SQLite | ✅ |
| Postgres | ✅ |
| MySQL | 🟧 (no data inlining*) |
*Data inlining for MySQL is not defined in the DuckLake specification.
Storage Backends
| Backend | Status |
|---|---|
| Local / NFS | ✅ |
| AWS S3-compatible | ✅ |
| Google Cloud Storage | ❌ |
| Azure Blob Storage | ❌ |
DuckLake Specification Versions
| Version | Status |
|---|---|
| 1.0 | ✅ (actively supported) |
| 0.4 | ⬆️ (requires migration) |
| 0.3 | ⬆️ (requires migration) |
| 0.2 | ⬆️ (requires migration) |
| 0.1 | ⬆️ (requires migration) |
See the DuckLake release calendar for upcoming versions.
Project Status
[!NOTE] This project is in alpha. It will move to beta once the full specification is implemented, and to stable once all relevant limitations have been addressed. Expect occasional breaking changes until then.
Not yet implemented from the specification
-
GEOMETRYandVARIANTdata types - Mapping columns by name (Parquet files must currently carry field IDs)
- Views, macros, sort info, and encrypted files
Known limitations
Rust SDK (may impact efficiency):
- Tables partitioned with a non-identity transform do not benefit from file pruning yet.
- Filters are not pushed down into the metadata query. Statistics are still loaded eagerly and used by readers to prune files, but the metadata query may transmit more data than necessary.
- Not tested on Windows.
Python SDK:
- Maintenance operations (compaction, snapshot expiration, ...) are dispatched to DuckDB rather than implemented natively.
- Performance of polars reads and writes can be optimized further:
- Writes currently require reading the file footer after the file has already been written (see also https://github.com/pola-rs/polars/issues/27226)
- Reads currently suffer from suboptimal footer reads (see also https://github.com/pola-rs/polars/issues/27227)
Contributing
Contributions, bug reports, and feature requests are very welcome. See the contribution guidelines to get started.
License
Licensed under the MIT License.
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 Distributions
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 ducklake_sdk-0.0.4.tar.gz.
File metadata
- Download URL: ducklake_sdk-0.0.4.tar.gz
- Upload date:
- Size: 193.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bded6bf90afc76db8a56bfc4c362c3543cdeaead57e485f414a0c204e3daddb1
|
|
| MD5 |
5c34992c67d5e2c95852948651b285ba
|
|
| BLAKE2b-256 |
25e33d56642d566a79890dce921b4b2354c851aa465c7eed9c115cf41db229f3
|
Provenance
The following attestation bundles were made for ducklake_sdk-0.0.4.tar.gz:
Publisher:
build.yml on borchero/ducklake-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ducklake_sdk-0.0.4.tar.gz -
Subject digest:
bded6bf90afc76db8a56bfc4c362c3543cdeaead57e485f414a0c204e3daddb1 - Sigstore transparency entry: 1500278194
- Sigstore integration time:
-
Permalink:
borchero/ducklake-sdk@fbdd0f4d9d91badcb5697c11ca7d5da4df0a8fcc -
Branch / Tag:
refs/tags/v0.0.4 - Owner: https://github.com/borchero
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@fbdd0f4d9d91badcb5697c11ca7d5da4df0a8fcc -
Trigger Event:
release
-
Statement type:
File details
Details for the file ducklake_sdk-0.0.4-cp310-abi3-win_amd64.whl.
File metadata
- Download URL: ducklake_sdk-0.0.4-cp310-abi3-win_amd64.whl
- Upload date:
- Size: 9.6 MB
- Tags: CPython 3.10+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3883204d23a60d947d55c65e32d8f3b702d1c9ad335fc63348fc02af7b37acf2
|
|
| MD5 |
da261938da687950ad9d2b3564227783
|
|
| BLAKE2b-256 |
c9ca46ef306ed1e0aa40cc129c0c328dd914ed29814b28f324d5f4d9908eb607
|
Provenance
The following attestation bundles were made for ducklake_sdk-0.0.4-cp310-abi3-win_amd64.whl:
Publisher:
build.yml on borchero/ducklake-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ducklake_sdk-0.0.4-cp310-abi3-win_amd64.whl -
Subject digest:
3883204d23a60d947d55c65e32d8f3b702d1c9ad335fc63348fc02af7b37acf2 - Sigstore transparency entry: 1500278408
- Sigstore integration time:
-
Permalink:
borchero/ducklake-sdk@fbdd0f4d9d91badcb5697c11ca7d5da4df0a8fcc -
Branch / Tag:
refs/tags/v0.0.4 - Owner: https://github.com/borchero
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@fbdd0f4d9d91badcb5697c11ca7d5da4df0a8fcc -
Trigger Event:
release
-
Statement type:
File details
Details for the file ducklake_sdk-0.0.4-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: ducklake_sdk-0.0.4-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 9.1 MB
- Tags: CPython 3.10+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
583e34236ce3e95e70f0ede43db07cad1afdfb4f0e1545c09a18af44abcbaa13
|
|
| MD5 |
a021268448a5295062b6a8268fb94256
|
|
| BLAKE2b-256 |
df52c0b176a382bd5a6f5a953f722b5313230c10e64399272f404e6c1da6ffbe
|
Provenance
The following attestation bundles were made for ducklake_sdk-0.0.4-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
build.yml on borchero/ducklake-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ducklake_sdk-0.0.4-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
583e34236ce3e95e70f0ede43db07cad1afdfb4f0e1545c09a18af44abcbaa13 - Sigstore transparency entry: 1500278730
- Sigstore integration time:
-
Permalink:
borchero/ducklake-sdk@fbdd0f4d9d91badcb5697c11ca7d5da4df0a8fcc -
Branch / Tag:
refs/tags/v0.0.4 - Owner: https://github.com/borchero
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@fbdd0f4d9d91badcb5697c11ca7d5da4df0a8fcc -
Trigger Event:
release
-
Statement type:
File details
Details for the file ducklake_sdk-0.0.4-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: ducklake_sdk-0.0.4-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 8.7 MB
- Tags: CPython 3.10+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc42f79d041e84d5bfd0d9a35d89794254d6364e86f590c048cd18c582aa0817
|
|
| MD5 |
d26afa4319435dc6cf77f64025d475c5
|
|
| BLAKE2b-256 |
e18bed6cc89ae67a31a6390f1320c6bd2cdaaba5e647089e1afb727685c72f1a
|
Provenance
The following attestation bundles were made for ducklake_sdk-0.0.4-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
build.yml on borchero/ducklake-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ducklake_sdk-0.0.4-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
fc42f79d041e84d5bfd0d9a35d89794254d6364e86f590c048cd18c582aa0817 - Sigstore transparency entry: 1500278519
- Sigstore integration time:
-
Permalink:
borchero/ducklake-sdk@fbdd0f4d9d91badcb5697c11ca7d5da4df0a8fcc -
Branch / Tag:
refs/tags/v0.0.4 - Owner: https://github.com/borchero
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@fbdd0f4d9d91badcb5697c11ca7d5da4df0a8fcc -
Trigger Event:
release
-
Statement type:
File details
Details for the file ducklake_sdk-0.0.4-cp310-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: ducklake_sdk-0.0.4-cp310-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 8.2 MB
- Tags: CPython 3.10+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
85e4cd4077f77ca78569d45840f8b7c3d8a26164e6c9ebf7e3f0d90ea843e725
|
|
| MD5 |
73c086e1bbfb2ccb8c539379fdbfe80c
|
|
| BLAKE2b-256 |
f1e01bde4ac56c0ad06f020815f18c47f54dc6685f7f7137372fa6200393e4c5
|
Provenance
The following attestation bundles were made for ducklake_sdk-0.0.4-cp310-abi3-macosx_11_0_arm64.whl:
Publisher:
build.yml on borchero/ducklake-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ducklake_sdk-0.0.4-cp310-abi3-macosx_11_0_arm64.whl -
Subject digest:
85e4cd4077f77ca78569d45840f8b7c3d8a26164e6c9ebf7e3f0d90ea843e725 - Sigstore transparency entry: 1500278284
- Sigstore integration time:
-
Permalink:
borchero/ducklake-sdk@fbdd0f4d9d91badcb5697c11ca7d5da4df0a8fcc -
Branch / Tag:
refs/tags/v0.0.4 - Owner: https://github.com/borchero
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@fbdd0f4d9d91badcb5697c11ca7d5da4df0a8fcc -
Trigger Event:
release
-
Statement type:
File details
Details for the file ducklake_sdk-0.0.4-cp310-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: ducklake_sdk-0.0.4-cp310-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 8.9 MB
- Tags: CPython 3.10+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8ac360d743e1dfc28d58c5b07d4e4052feaa54ed25e4a0d1242f3f3bc7d7e00
|
|
| MD5 |
bd0772c38ceaa3ebf023ca7d0b1309d0
|
|
| BLAKE2b-256 |
8f94d1cb00ff759c4695a7016da979343c7bf100decf1bae0cd55f94ab53f2ee
|
Provenance
The following attestation bundles were made for ducklake_sdk-0.0.4-cp310-abi3-macosx_10_12_x86_64.whl:
Publisher:
build.yml on borchero/ducklake-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ducklake_sdk-0.0.4-cp310-abi3-macosx_10_12_x86_64.whl -
Subject digest:
b8ac360d743e1dfc28d58c5b07d4e4052feaa54ed25e4a0d1242f3f3bc7d7e00 - Sigstore transparency entry: 1500278591
- Sigstore integration time:
-
Permalink:
borchero/ducklake-sdk@fbdd0f4d9d91badcb5697c11ca7d5da4df0a8fcc -
Branch / Tag:
refs/tags/v0.0.4 - Owner: https://github.com/borchero
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@fbdd0f4d9d91badcb5697c11ca7d5da4df0a8fcc -
Trigger Event:
release
-
Statement type: