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.
- class lucidlink.client.Client(*, storage: StorageConfig | None = None, config: ClientConfig | None = None)[source]
Bases:
objectLucidLink SDK client.
Manages the connection to LucidLink for one service-account credential. Each
Clientinstance 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
Note
When running multiple concurrent clients, give each one a distinct
Storageso their per-filespace state lives under separate roots.- close() None[source]
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 newClientfor further work.
- get_workspace(id: str) Workspace[source]
Return the workspace with the given id.
- Parameters:
id – The workspace id (from
list_workspaces()).- Returns:
The live
Workspacefor filespace operations.- Raises:
AuthenticationError – If the client is not logged in.
ValueError – If
iddoes not match any accessible workspace.
- property is_logged_in: bool
Whether
login()has been called successfully and not yetclose()-d.
- list_workspaces() List[WorkspaceInfo][source]
List workspaces this client’s credentials grant access to.
- Returns:
A list of
WorkspaceInfodescriptors, one per accessible workspace. Pass an id toget_workspace()to obtain an operableWorkspacehandle.- Raises:
AuthenticationError – If the client is not logged in.
- login(credentials: ServiceAccountCredentials) None[source]
Authenticate to LucidLink with a service account token.
The token determines which workspace this client operates on.
- Parameters:
credentials – Service account credentials.
- Raises:
AuthenticationError – If already logged in with different credentials, or if authentication fails.
ClientError – If the client cannot be started.
- class lucidlink.client.ClientConfig(fs_cache_size_mb: int | None = None)[source]
Bases:
objectTyped configuration for
Client.All fields are optional;
Nonemeans “use the built-in default”.Example:
client = Client(config=ClientConfig( fs_cache_size_mb=2048, ))
- fs_cache_size_mb: int | None = None
1024 MB.
- Type:
Per-filespace disk cache size in megabytes. Default