client
LucidLink Python Library - Client.
Top-level entry point for the LucidLink SDK. Each Client is fully independent, so multiple clients can coexist in one process and operate on different workspaces concurrently.
lucidlink.client.Client
Client(storage: Optional[StorageConfig] = None, config: Optional[ClientConfig] = None)Parameter | Description |
|---|---|
| Storage configuration. Defaults to SANDBOXED (temp directory, cleaned up on close). For concurrent clients, supply a distinct StorageConfig per client. |
| Typed client configuration. See ClientConfig. |
storage
Description
Storage configuration. Defaults to SANDBOXED (temp directory, cleaned up on close). For concurrent clients, supply a distinct StorageConfig per client.
config
Description
Typed client configuration. See ClientConfig.
LucidLink SDK client.
Manages the connection to LucidLink for one service-account credential. Each Client instance is fully independent; multiple clients can run side-by-side in the same process and operate on different workspaces concurrently.
Lifecycle
client = Client()client.login(credentials)workspace = client.get_workspace(workspace_id)# ... use workspace ...client.close()
Or as a context manager
with Client() as client:client.login(credentials)workspace = client.get_workspace(workspace_id)# ... use workspace ...
Multi-client (concurrent multi-account)
client_a = Client(storage=StorageConfig(mode=StorageMode.SANDBOXED))client_b = Client(storage=StorageConfig(mode=StorageMode.SANDBOXED))client_a.login(creds_a)client_b.login(creds_b)# both fully independent, with separate storage
When running multiple concurrent clients, give each one a distinct Storage so their per-filespace state lives under separate roots.
close() -> None
Tear down the client: unlink all filespaces and release resources.
Safe to call multiple times. After close(), the client must not be reused — create a new Client for further work.
get_workspace(id: str) -> Workspace
Return the workspace with the given id.
Parameters
Parameter | Description |
|---|---|
| The workspace id (from list_workspaces()). |
id
Description
The workspace id (from list_workspaces()).
Returns
The live Workspace for filespace operations.
Raises
Exception | Condition |
|---|---|
If the client is not logged in. | |
| If id does not match any accessible workspace. |
ValueError
Condition
If id does not match any accessible workspace.
list_workspaces() -> List[WorkspaceInfo]
List workspaces this client's credentials grant access to.
Returns
A list of WorkspaceInfo descriptors, one per accessible workspace. Pass an id to get_workspace to obtain an operable Workspace handle.
Raises
Exception | Condition |
|---|---|
If the client is not logged in. |
login(credentials: ServiceAccountCredentials) -> None
Authenticate to LucidLink with a service account token.
The token determines which workspace this client operates on.
Parameters
Parameter | Description |
|---|---|
| Service account credentials. |
credentials
Description
Service account credentials.
Raises
Exception | Condition |
|---|---|
If already logged in with different credentials, or if authentication fails. | |
If the client cannot be started. |
Condition
If already logged in with different credentials, or if authentication fails.
lucidlink.client.ClientConfig
Typed configuration for Client.
All fields are optional; None means "use the built-in default".
Example
client = Client(config=ClientConfig(cache=CacheConfig(data_bytes=2 * 1024 * 1024 * 1024),))
Attribute | Type | Description |
|---|---|---|
|
| Default cache sizes applied atomically on every link_filespace call. |
cache
Type
Optional[CacheConfig]Description
Default cache sizes applied atomically on every link_filespace call.