Skip to main content

pylakekeeper — Lakekeeper Python Client

Website Discord PyPI

License Python versions python-ci

Please visit https://docs.lakekeeper.io for Documentation!

pylakekeeper is the official Python client for Lakekeeper, an Apache-Licensed, secure, fast and easy to use implementation of the Apache Iceberg REST Catalog specification.

It covers the two things a plain Iceberg REST client cannot do for you: the Generic Tables API — register Lance, Delta, Parquet, images or any other dataset format as first-class catalog tables — and Storage Access Management, mapping Lakekeeper's vended credentials straight into the keys that lance, boto3, fsspec and deltalake already expect. If you have questions, feature requests or just want a chat, we are hanging around in Discord!

Quickstart

pip install pylakekeeper
from pylakekeeper import Client, StaticToken

lk = Client(
    base_url="http://localhost:8181",
    warehouse="my-warehouse",
    auth=StaticToken("my-token"),
)

# Register a Lance dataset as a generic table
lk.generic_tables.create("ai.models", "embeddings", format="lance")

# Load it back with short-lived, vended S3 credentials
resp = lk.generic_tables.load("ai.models", "embeddings", vended=True)

import lance

lance.write_dataset(data, resp.location, storage_options=resp.lance_storage_options)

# ...or open the same location as an fsspec filesystem
import fsspec

fs = fsspec.filesystem("s3", **resp.fsspec_kwargs)
print(fs.ls(resp.location))

Need a running catalog first? The Lakekeeper Getting Started Guide brings one up with docker compose in a couple of minutes.

Scope and Features

pylakekeeper is deliberately small: httpx + pydantic, nothing else. It is not a general-purpose Iceberg REST client — for the standard Iceberg surface use PyIceberg, which pairs with this happily (pip install 'pylakekeeper[iceberg]').

  • Generic Tables: Register non-Iceberg datasets (Lance, Delta, Parquet, images, HDF5) as first-class catalog tables and get create / load / list / drop without faking Iceberg metadata.
  • Vended Credentials: LoadGenericTableResponse exposes lance_storage_options and fsspec_kwargs, so short-lived credentials flow into your reader with no manual key-mapping.
  • OpenID Provider Integration: client_credentials, device_code and authorization_code flows, all with automatic token refresh — or just a StaticToken.
  • Fully Typed: Ships py.typed; the package is checked under mypy --strict.
  • Well-Tested: Unit tests plus an integration suite that runs a real round-trip against Lakekeeper, Postgres, MinIO and Keycloak via docker compose.

If you are missing something, we would love to hear about it in a GitHub Issue.

Status

Authentication Flows

Flow Status Comment
Static Token done StaticToken — bring your own bearer token
OAuth2 Client Credentials done ClientCredentials, refreshes automatically
OAuth2 Device Code done DeviceCodeFlow — for CLIs and notebooks
OAuth2 Authorization Code done AuthorizationCodeFlow — local redirect server

Generic Table Operations

Operation Status Comment
Create done Any format identifier — see below
Load done Optional credential vending via vended=True
List done Paginated
Drop done
Rename open Not yet exposed by the client

GenericTableFormat provides constants for lance, delta, vortex, paimon and dataset, but Lakekeeper stores the format as a free identifier — any string matching ^[a-z][a-z0-9_-]{0,63}$ is accepted, so pass a plain str for anything not listed.

Storage Backends

Storage Status Comment
S3 - AWS done Vended credentials mapped to Lance / boto3 / fsspec
S3 - Custom done MinIO, SeaweedFS and friends; allow_http set automatically
Azure ADLS Gen2 open No credential translation yet — raw vended properties are still available on the response
Google Cloud Storage open No credential translation yet — raw vended properties are still available on the response

Optional Extras

Extra Installs
pip install 'pylakekeeper[lance]' pylance — write and read Lance datasets
pip install 'pylakekeeper[iceberg]' pyiceberg — standard Iceberg catalog surface
pip install 'pylakekeeper[examples]' Everything the notebooks and demo scripts need

Examples

Runnable scripts and notebooks live in python/examples/:

Example Description
generic_tables_lance.py Create a Lance generic table, write and read a dataset with vended credentials
dataset_images.py Upload image files to a dataset generic table via boto3
auth_clientcredentials_delta.ipynb OAuth2 client-credentials + a Delta Lake round-trip
auth_devicecode_lance.ipynb Device-code login from a notebook
auth_devicecode_hdf5.ipynb Store HDF5 files in a dataset table
auth_authcode_vortex.ipynb Authorization-code flow with Vortex

API Reference

Object Purpose
Client Entry point; holds base URL, warehouse and auth
client.generic_tables create / load / list / drop generic tables
StaticToken, ClientCredentials, DeviceCodeFlow, AuthorizationCodeFlow Auth strategies
LoadGenericTableResponse Location plus lance_storage_options / fsspec_kwargs
iceberg_creds_to_lance, iceberg_creds_to_fsspec Credential mapping helpers

All errors derive from LakekeeperError: NotFoundError, ConflictError, AuthError, ConfigError, LakekeeperHTTPError.

Contributing

The client lives in the lakekeeper-clients monorepo alongside the Java and Spark clients.

git clone https://github.com/lakekeeper/lakekeeper-clients.git
cd lakekeeper-clients/python
pip install -e '.[dev]'
pytest tests/                        # unit tests
pytest tests/integration -m integration  # needs Docker

License

Licensed under the Apache License, Version 2.0

Download files

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

Source Distribution

pylakekeeper-0.3.1.tar.gz (307.0 kB view details)

Uploaded Source

Built Distribution

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

pylakekeeper-0.3.1-py3-none-any.whl (20.9 kB view details)

Uploaded Python 3

File details

Details for the file pylakekeeper-0.3.1.tar.gz.

File metadata

  • Download URL: pylakekeeper-0.3.1.tar.gz
  • Upload date:
  • Size: 307.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pylakekeeper-0.3.1.tar.gz
Algorithm Hash digest
SHA256 f657b43be8f6022eb0fa79cbac3b6f01cda2c577320fd69f536122e068d0c821
MD5 bcef1bb8f9183615608e85a541cfdc0d
BLAKE2b-256 7461728828aad3f71a7f7da0468e3a76e68eb6675812cd44d9306f97ed73de1b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pylakekeeper-0.3.1.tar.gz:

Publisher: release.yml on lakekeeper/lakekeeper-clients

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

File details

Details for the file pylakekeeper-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: pylakekeeper-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 20.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pylakekeeper-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9ae77115b8f57fc0d912ea7a2c15ad563bca8c453471677cdd551399734389cd
MD5 9da32000773c5c43ff548be542ef7c1f
BLAKE2b-256 de942498344e8bee1ecb284e14d243f80339d6e9a527de386252aed13ef9f980

See more details on using hashes here.

Provenance

The following attestation bundles were made for pylakekeeper-0.3.1-py3-none-any.whl:

Publisher: release.yml on lakekeeper/lakekeeper-clients

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

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 files

0.3.0

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page