Skip to main content

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.

CI Build GitHub Release


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)

pypi-version conda-forge python-version readthedocs codecov

Rust (ducklake)

crates.io docs.rs codecov

[!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:

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

  • GEOMETRY and VARIANT data 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:

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ducklake_sdk-0.0.9.tar.gz (196.5 kB view details)

Uploaded Source

Built Distributions

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

ducklake_sdk-0.0.9-cp310-abi3-win_amd64.whl (10.0 MB view details)

Uploaded CPython 3.10+Windows x86-64

ducklake_sdk-0.0.9-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.5 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

ducklake_sdk-0.0.9-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (9.0 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

ducklake_sdk-0.0.9-cp310-abi3-macosx_11_0_arm64.whl (8.6 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

ducklake_sdk-0.0.9-cp310-abi3-macosx_10_12_x86_64.whl (9.2 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file ducklake_sdk-0.0.9.tar.gz.

File metadata

  • Download URL: ducklake_sdk-0.0.9.tar.gz
  • Upload date:
  • Size: 196.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for ducklake_sdk-0.0.9.tar.gz
Algorithm Hash digest
SHA256 9899b001e26a6d9c0930cd4138a7c7c9d23629dc949b39ae42c25e2d05c2145d
MD5 9a12918b6114665b3ff0f880f5fe462b
BLAKE2b-256 a7d11c4ce3ec75fa01bea04ce56e84b5e45da40f0aa5bb15aacec71c1d6668ef

See more details on using hashes here.

Provenance

The following attestation bundles were made for ducklake_sdk-0.0.9.tar.gz:

Publisher: build.yml on borchero/ducklake-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ducklake_sdk-0.0.9-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: ducklake_sdk-0.0.9-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 10.0 MB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for ducklake_sdk-0.0.9-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 163380861418b6fa2e34d39d57f9e8f45e48ea678f6645df139c36debeaf3baa
MD5 17a56a4fd36bed54994bf3d85f984b4c
BLAKE2b-256 5debe16462645a089bb23d624bc111330cdfd628c45d8b90d62b2a1edb2aff25

See more details on using hashes here.

Provenance

The following attestation bundles were made for ducklake_sdk-0.0.9-cp310-abi3-win_amd64.whl:

Publisher: build.yml on borchero/ducklake-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ducklake_sdk-0.0.9-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ducklake_sdk-0.0.9-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ca0155fd0d7f3001181418efbaeed1ed106699b88c0825d6b0e2ccb1dd6f19a7
MD5 188417b7be083733bdb7cefe9f2ac1d3
BLAKE2b-256 63536d7037a80f87a2158c20dfedbffef92c55209876bc6456bba8f768fa6e98

See more details on using hashes here.

Provenance

The following attestation bundles were made for ducklake_sdk-0.0.9-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build.yml on borchero/ducklake-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ducklake_sdk-0.0.9-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for ducklake_sdk-0.0.9-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 575a53a30bc1beee3f993f28bc4dece5e34b162dd43c9d9999cbfe1c76b644a5
MD5 3dd1a5b0ac88ba007ec5a8bc006d03e8
BLAKE2b-256 2b10aa33861fc749cef2f292f6ae0aac68dbc6361fc092ccbff3d871451c5a82

See more details on using hashes here.

Provenance

The following attestation bundles were made for ducklake_sdk-0.0.9-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: build.yml on borchero/ducklake-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ducklake_sdk-0.0.9-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ducklake_sdk-0.0.9-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3a708f2f2e95a02cd7830c9d7599f1d1182c7d81c67c3811620c43efa6da7f8b
MD5 481c27977bf151ba25c9990b87d02939
BLAKE2b-256 481090574f076cea1697155c623ebf4892b31ec94292f86e3bb96b152aaf727c

See more details on using hashes here.

Provenance

The following attestation bundles were made for ducklake_sdk-0.0.9-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: build.yml on borchero/ducklake-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ducklake_sdk-0.0.9-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for ducklake_sdk-0.0.9-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f5196f9c476e8ffc11c0d981f3333f2f2eec4253b2753f71e787d0c1923de9b6
MD5 105d78454b3370221a19b7b1198effaa
BLAKE2b-256 7adea05d83fb48fe6a6f56d4160773ba7282ffee578b9b8a6d67add17280b079

See more details on using hashes here.

Provenance

The following attestation bundles were made for ducklake_sdk-0.0.9-cp310-abi3-macosx_10_12_x86_64.whl:

Publisher: build.yml on borchero/ducklake-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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