duckbricks-utils
DuckLake connection utilities for DuckBricks notebooks and pipelines.
Provides a consistent interface for connecting to a DuckLake catalog backed by PostgreSQL, from any environment — local IDE, Marimo notebooks, or job executors. Supports multiple storage backends (local, S3, MinIO, Cloudflare R2, GCS, Azure Blob).
Installation
pip install duckbricks-utils
Quick start
from duckbricks_utils import connect
conn = connect()
result = conn.execute("SELECT * FROM my_table LIMIT 10").df()
Configuration
All settings are read from environment variables (a .env file is supported via python-dotenv).
PostgreSQL catalog
| Variable | Default | Description |
|---|---|---|
DUCKLAKE_PG_HOST |
localhost |
PostgreSQL host |
DUCKLAKE_PG_PORT |
5432 |
PostgreSQL port |
DUCKLAKE_PG_DATABASE |
duckbricks |
PostgreSQL database name |
DUCKLAKE_PG_USER |
duckbricks |
PostgreSQL user |
DUCKLAKE_PG_PASSWORD |
duckbricks |
PostgreSQL password |
DUCKBRICKS_DUCKLAKE_NAME |
duckbricks |
DuckLake catalog name |
Storage backend
Set DUCKBRICKS_STORAGE_BACKEND to one of the supported values (default: local).
| Backend | DUCKBRICKS_STORAGE_BACKEND |
|---|---|
| Local filesystem | local |
| Amazon S3 | s3 |
| MinIO | minio |
| Cloudflare R2 | r2 |
| Google Cloud Storage | gcs |
| Azure Blob Storage | azure |
Each backend reads its own credentials from environment variables (e.g. AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY for S3).
Local backend
| Variable | Default | Description |
|---|---|---|
DUCKBRICKS_DATA_PATH |
/data/parquet/ |
Parquet storage path |
API reference
from duckbricks_utils import connect, catalog_name, data_path
from duckbricks_utils import StorageBackend, StorageBackendFactory
# Open a DuckDB connection with the DuckLake catalog attached
conn = connect()
# Open a connection with a custom data path override
conn = connect(override_data_path="/tmp/my_data/")
# Get the configured catalog name
name = catalog_name()
# Get the active backend's data path
path = data_path()
# Resolve the backend from environment
backend = StorageBackendFactory.from_env()
# List all supported backend names
backends = StorageBackendFactory.supported_backends()
Requirements
- Python ≥ 3.11
- DuckDB ≥ 1.3.0
Metadata
Release files for duckbricks-utils 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| duckbricks_utils-0.1.2.tar.gz | 4.4 kB | Without provenance | Details for duckbricks_utils-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| duckbricks_utils-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for duckbricks_utils-0.1.2-py3-none-any.whl |
Total release size: 13.9 kB
Release files / duckbricks_utils-0.1.2.tar.gz
| Download URL | duckbricks_utils-0.1.2.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6e32c1d687a8c241c53756d956a76bf0000141a75a9f3697d93dc6a4db436bd5
|
|
BLAKE2b-256 checksum How to use checksums |
0f2794d2fdc69a4903ba89be42440560ff9731b92d878e3340efb37937a34502
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.1 CPython/3.13.2 Darwin/25.4.0
|
Release files / duckbricks_utils-0.1.2-py3-none-any.whl
| Download URL | duckbricks_utils-0.1.2-py3-none-any.whl |
|---|---|
| Size | 9.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f181543e16c3b366430f0452791734512045c72b639124d559343c8ea8b8ad00
|
|
BLAKE2b-256 checksum How to use checksums |
9a8fb56f54f9ea79ffb7fcedde42c2d40309130efab5ef92573b60a1170fc788
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.1 CPython/3.13.2 Darwin/25.4.0
|
Security for duckbricks-utils 0.1.2
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.