Storage
Base
pluginlake.core.storage.base
Base class for pluggable storage backends.
StorageBackend
Bases: ABC
Abstract base class for storage backends.
Storage backends define where DuckLake stores its data files and how DuckDB connects to that storage. Implementations handle local filesystems, cloud object stores, and other storage systems.
Each backend provides
- A base path for DuckLake file storage (DATA_PATH).
- DuckDB extension configuration for accessing the storage.
Source code in src/pluginlake/core/storage/base.py
get_base_path()
abstractmethod
Return the root path for file storage.
For local storage, this is a filesystem path.
For cloud storage, this is a URI (e.g., s3://bucket/prefix/).
Used as DuckLake's DATA_PATH.
Source code in src/pluginlake/core/storage/base.py
configure_duckdb(conn)
abstractmethod
Configure a DuckDB connection to access this storage.
Install and load any required extensions, set credentials, and apply any other necessary configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
conn
|
DuckDBPyConnection
|
An open DuckDB connection to configure. |
required |
Source code in src/pluginlake/core/storage/base.py
Local Backend
pluginlake.core.storage.local
Local filesystem storage backend.
LocalStorageBackend
Bases: StorageBackend
Storage backend that uses the local filesystem.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_path
|
str | Path
|
Root directory for file storage. Created automatically if it does not exist. |
required |
Source code in src/pluginlake/core/storage/local.py
__init__(base_path)
Initialise with the root directory for file storage.
get_base_path()
Layer Manager
pluginlake.core.storage.layers
Storage layer manager for the medallion architecture.
Provides a high-level interface for working with the raw / processed / output
storage layers on top of a :class:~pluginlake.core.storage.base.StorageBackend.
StorageLayerManager
Manages the medallion-architecture directory structure.
Wraps a :class:StorageBackend and the corresponding
:class:StorageSettings to provide layer-aware path resolution
and directory initialisation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
settings
|
StorageSettings | None
|
Storage configuration with layer paths. |
None
|
backend
|
StorageBackend | None
|
Optional storage backend override. When None, the
backend is resolved from |
None
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If the configured storage backend is not supported. |
Source code in src/pluginlake/core/storage/layers.py
raw_dir
property
Shortcut to the raw (bronze) layer directory.
processed_dir
property
Shortcut to the processed (silver) layer directory.
output_dir
property
Shortcut to the output (gold) layer directory.
backend
property
The underlying storage backend.
settings
property
The active storage settings.
__init__(settings=None, backend=None)
Initialise with storage settings and an optional backend override.
Source code in src/pluginlake/core/storage/layers.py
initialize()
Create all storage layer directories.
Idempotent — safe to call multiple times.
Source code in src/pluginlake/core/storage/layers.py
get_path(layer, *parts)
Return a path within a specific storage layer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layer
|
StorageLayer
|
Target storage layer. |
required |
*parts
|
str
|
Additional path segments appended after the layer dir. |
()
|
Returns:
| Type | Description |
|---|---|
Path
|
Absolute path for the requested resource. |