Skip to main content

databaas-utils

Lakekeeper/Iceberg lakehouse access for Databaas: catalog, remote-signed object storage, an Airflow integration, and user access from notebooks — in JupyterHub or on a laptop.

Notebooks

from databaas_utils.notebook import get_catalog, get_store, get_zarr_group

catalog = get_catalog()
catalog.load_table("open_meteo.daily_summary").scan(limit=10).to_arrow()

group = get_zarr_group("harmonie_zarr", namespace="knmi", read_only=True)

databaas_utils.notebook authenticates as the person running the notebook and picks how by itself:

  • In a Databaas JupyterHub pod it asks the hub for the logged-in user's access token (GET /hub/api/oauth-token, using the JUPYTERHUB_API_URL/JUPYTERHUB_API_TOKEN every singleuser pod has). The catalog is CATALOG_URI (default http://lakekeeper:8181) and the warehouse LAKEKEEPER_WAREHOUSE (default databaas-lakehouse).
  • Anywhere else it uses the session saved by databaas login (below).

So the same notebook runs on the platform and on a laptop. Pass profile= to force a databaas login profile, or warehouse= to override the warehouse. DAGs must not use this module — a task authenticates through its Airflow connection (databaas_utils.airflow).

Local (analyst) quickstart

pip install "databaas-utils[local]"
databaas login https://<your-environment>.databaas.eu

databaas login discovers the environment's Zitadel/Lakekeeper settings from the portal, opens a browser to sign in with your own identity, and caches the session (in your OS keychain) so future Python processes don't prompt again. If no browser is reachable (e.g. over SSH), pass --device to use the OAuth2 device-code flow instead.

from databaas_utils import LakehouseSettings, rest_catalog

settings = LakehouseSettings.from_profile()  # picks up the login from `databaas login`
catalog = rest_catalog(settings)
catalog.list_namespaces()

resolve()/GenericTableStore/open_zarr_group() work the same way once you have settings — see their docstrings. An admin still has to grant your Lakekeeper user (databaas whoami shows its id, oidc~<sub>) access to a warehouse before any of this returns data.

Useful commands:

Command What it does
databaas login [PORTAL_URL] Log in and save a profile
databaas whoami Show the signed-in identity and Lakekeeper user id
databaas token Print a fresh access token (e.g. for curl, DuckDB)
databaas logout Revoke and forget the cached login
databaas profile list / databaas profile use NAME Manage saved profiles

Several environments can be configured at once as named profiles in ~/.config/databaas/config.toml; select one with --profile NAME or DATABAAS_PROFILE.

Admin runbook: registering the local-login app in Zitadel

Local login needs one Zitadel Native app per environment, created by hand today — databaas-core/packages/bootstrap does not yet support the app type or grant this needs (see "Follow-up" below). In the Zitadel console, under the Databaas project:

  1. New application → type Native, authentication method None (PKCE proves possession instead of a secret).
  2. Grant types: Authorization Code, Refresh Token, and Device Code.
  3. Redirect URIs: http://127.0.0.1/callback and http://localhost/callback — the CLI binds an OS-assigned loopback port and matches on path only, so a single registered host is enough (confirm this against the deployed Zitadel version; if it requires an exact port, pin one with the profile's redirect_port and register that port explicitly instead).
  4. Token settings: Auth Token Type JWT (Lakekeeper validates access tokens against Zitadel's JWKS; an opaque token is rejected).
  5. Note the app's Client ID and the project's Project ID — a user provides these (or the portal's discovery document supplies them) when running databaas login.

Portal discovery document

databaas login <portal-url> expects the portal to serve, unauthenticated:

GET /.well-known/databaas-client.json

{
  "issuer": "https://auth.<env>.databaas.eu",
  "client_id": "<native app client id>",
  "project_id": "<zitadel project id>",
  "catalog_url": "https://catalog.<env>.databaas.eu",
  "warehouse": "databaas-lakehouse",
  "region": "nl-ams"
}

Until the portal ships this, pass the equivalent --issuer/--client-id/--project-id/ --catalog-url/--warehouse flags to databaas login instead.

Follow-up: bootstrap support

databaas-core/packages/bootstrap's schema (bootstrap-config.schema.json) and Zitadel client currently only support appType ∈ {WEB, USER_AGENT} and grantTypes ∈ {AUTHORIZATION_CODE, REFRESH_TOKEN}. Extending both to NATIVE and DEVICE_CODE would let a "Databaas CLI" app be declared in bootstrap.example.yaml like the other apps and remove the manual step above. Out of scope for this package.

Metadata

Release files for databaas-utils 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for databaas-utils 0.4.0
File Size Uploaded
databaas_utils-0.4.0.tar.gz 47.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for databaas-utils 0.4.0
File Interpreter ABI Platform
databaas_utils-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 107.4 kB

Release files / databaas_utils-0.4.0.tar.gz

Download URL databaas_utils-0.4.0.tar.gz
Size 47.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ef9d0edab1a3b0569c40c8f3b7b51889620af2b602462688bc18afd1fb2d8ab7
BLAKE2b-256 checksum
How to use checksums
448d7045ba6e8031f609c5865c7abde87855ea19477f0defe8aba9896977e701
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.

Transparency log

Release files / databaas_utils-0.4.0-py3-none-any.whl

Download URL databaas_utils-0.4.0-py3-none-any.whl
Size 59.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5dade8af92874966ef8a5c118fc02f0c972fe4bf77cd616fc74e3004c7c9ff60
BLAKE2b-256 checksum
How to use checksums
728583d450358e383b7a55c8c6414b648124bc3eee7cfcf5075fabc63d773634
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.

Transparency log

Release history Release notifications | RSS feed

0.6.0

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

This release

0.4.0 This release

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release 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