Skip to main content

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

Client(storage: Optional[StorageConfig] = None, config: Optional[ClientConfig] = None)

Parameter

Description

storage

Storage configuration. Defaults to SANDBOXED (temp directory, cleaned up on close). For concurrent clients, supply a distinct StorageConfig per client.

config

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.

property

is_logged_in: bool

Whether login() has been called successfully and not yet close()-d.

method

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.

method

get_workspace(id: str) -> Workspace

Return the workspace with the given id.

Parameters

Parameter

Description

id

The workspace id (from list_workspaces()).

id

Description

The workspace id (from list_workspaces()).

Returns

The live Workspace for filespace operations.

Raises

Exception

Condition

AuthenticationError

If the client is not logged in.

ValueError

If id does not match any accessible workspace.

Condition

If the client is not logged in.

ValueError

Condition

If id does not match any accessible workspace.

method

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

AuthenticationError

If the client is not logged in.

Condition

If the client is not logged in.

method

login(credentials: ServiceAccountCredentials) -> None

Authenticate to LucidLink with a service account token.

The token determines which workspace this client operates on.

Parameters

Parameter

Description

credentials

Service account credentials.

credentials

Description

Service account credentials.

Raises

Exception

Condition

AuthenticationError

If already logged in with different credentials, or if authentication fails.

ClientError

If the client cannot be started.

Condition

If already logged in with different credentials, or if authentication fails.

Condition

If the client cannot be started.

dataclass

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

cache

Optional[CacheConfig]

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.