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.

Language Version Docs Testing Status
Python (ducklake-sdk) pypi-version readthedocs codecov
Rust (ducklake) crates.io docs.rs codecov

All language SDKs are built on the same Rust core, which bundles a complete implementation of the DuckLake specification.

[!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.3.tar.gz (194.2 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.3-cp310-abi3-win_amd64.whl (9.6 MB view details)

Uploaded CPython 3.10+Windows x86-64

ducklake_sdk-0.0.3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.1 MB view details)

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

ducklake_sdk-0.0.3-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (8.7 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

ducklake_sdk-0.0.3-cp310-abi3-macosx_11_0_arm64.whl (8.2 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

ducklake_sdk-0.0.3-cp310-abi3-macosx_10_12_x86_64.whl (8.9 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for ducklake_sdk-0.0.3.tar.gz
Algorithm Hash digest
SHA256 2b8712f45470475852e030e83f4c1e592a18229c39b831a6626659f37dac8934
MD5 dc33db3d68ec1baf16ed73a155ac8d07
BLAKE2b-256 ba65943ba6b9818e5810b9a5397d5b7a5c7a04ad8ccd275914d1b83585742cb0

See more details on using hashes here.

Provenance

The following attestation bundles were made for ducklake_sdk-0.0.3.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.3-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for ducklake_sdk-0.0.3-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 0db0675524a1fec5ae2ab9b6bd246394afa54771be21d2ba24af7487b15dcb11
MD5 032fc4d86a5b3abc9a2cf3b1eae2dc69
BLAKE2b-256 27a4feef38316f73e20fba7d0b145de7cba5435d5d24d130d27947dc95916823

See more details on using hashes here.

Provenance

The following attestation bundles were made for ducklake_sdk-0.0.3-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.3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ducklake_sdk-0.0.3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 33cc9e49d53c9c9c43dfd3a70f8737b108f9f4c9d09cdd122e016d771c8d9b93
MD5 089588cb3211a7146133b7c510f825a4
BLAKE2b-256 2966a509bdabd6c71331c984b0202137cdd856de1447306f93e16624529febd2

See more details on using hashes here.

Provenance

The following attestation bundles were made for ducklake_sdk-0.0.3-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.3-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for ducklake_sdk-0.0.3-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f784e920a3619a5e894e28ed3f4a2bdcd1dabd32ab4b6d3e086492a4cc59fea7
MD5 75530fe4b7f1f6fdc1a1614451ba63a9
BLAKE2b-256 e0ec33ac82ce7da5bc970cea6be8bde490909693e34e48a5930f203b369fd47b

See more details on using hashes here.

Provenance

The following attestation bundles were made for ducklake_sdk-0.0.3-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.3-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ducklake_sdk-0.0.3-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dc8878551120393d45bc4499e73296c3c159c60be4c07add73c64d46e065f8d7
MD5 b45c9221d8b692c42247ca4d98c58d79
BLAKE2b-256 bd7d7f8f16d395fdd34187e7fcd43e03afc88af5ef4e6ee3031d55cf85339c2b

See more details on using hashes here.

Provenance

The following attestation bundles were made for ducklake_sdk-0.0.3-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.3-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for ducklake_sdk-0.0.3-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ea2a0efa1fff81772f638ba37eb2ca46c320a77ba5cf8622d05b3f93933dd0de
MD5 cad80519067c539d72ac69551848382a
BLAKE2b-256 a0e9b4354af1c68dab7a6e1d6370650755093e5f25182b47324e6eba816f4009

See more details on using hashes here.

Provenance

The following attestation bundles were made for ducklake_sdk-0.0.3-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