Skip to main content

daemon

LucidLink Python Library - Daemon Management

High-level Pythonic wrapper for the LucidLink daemon. Provides context manager support for daemon lifecycle management.

deprecatedclass

lucidlink.daemon.Daemon

This API is deprecated.

Daemon(config: Optional[Dict[str, str]] = None, storage: Optional[StorageConfig] = None)

Parameter

Description

config

Optional configuration dictionary. Common keys: - "fs.cache.location": Cache directory path (overridden by storage) - "fs.cache.size": Cache size in MB (as string) If None, uses default configuration.

storage

Storage configuration for daemon files. If None, defaults to SANDBOXED mode (temp directory, always cleaned up). See StorageConfig for details on PHYSICAL and SANDBOXED modes.

config

Description

Optional configuration dictionary. Common keys: - "fs.cache.location": Cache directory path (overridden by storage) - "fs.cache.size": Cache size in MB (as string) If None, uses default configuration.

storage

Description

Storage configuration for daemon files. If None, defaults to SANDBOXED mode (temp directory, always cleaned up). See StorageConfig for details on PHYSICAL and SANDBOXED modes.

High-level Python wrapper for the LucidLink daemon.

The Daemon class manages the lifecycle of the LucidLink daemon process, handles authentication, and provides access to workspaces and filespaces.

Deprecated. Use lucidlink.Client instead. Daemon remains functional for existing callers but receives no new features.

Example

from lucidlink import Daemon, ServiceAccountCredentials
# Create credentialscredentials = ServiceAccountCredentials(token="sa_live:your_key")
# Start daemon and authenticatedaemon = Daemon(config)daemon.start()workspace = daemon.authenticate(credentials)
# List and link to filespacefilespaces = workspace.list_filespaces()filespace = workspace.link_filespace(name="production-data")
# Use filesystementries = filespace.fs.read_dir("/")
# Cleanupdaemon.stop()
deprecatedmethod

authenticate(credentials: ServiceAccountCredentials) -> Workspace

Authenticate to LucidLink using service account credentials.

Must call start() before authenticate().

Parameters

Parameter

Description

credentials

ServiceAccountCredentials object containing the service account token

credentials

Description

ServiceAccountCredentials object containing the service account token

Returns

Workspace object providing access to filespace operations

Raises

Exception

Condition

DaemonError

If daemon is not started

AuthenticationError

If authentication fails

ValueError

If credentials are invalid

Condition

If daemon is not started

Condition

If authentication fails

ValueError

Condition

If credentials are invalid

Example

from lucidlink import Daemon, ServiceAccountCredentialscredentials = ServiceAccountCredentials(token="sa_live:your_key")daemon = Daemon()daemon.start()workspace = daemon.authenticate(credentials)print(workspace.name)
deprecatedmethod

is_running() -> bool

Check if the daemon is currently running.

Returns

True if daemon is started, False otherwise

deprecatedmethod

start() -> None

Start the daemon services.

Must be called before authentication or filespace linking. Safe to call multiple times - subsequent calls are no-ops.

Note: Only one daemon can be active per process due to C++ global state. Attempting to start a second daemon while one is already running will raise DaemonError.

Raises

Exception

Condition

DaemonError

If daemon start fails or another daemon is already active

Condition

If daemon start fails or another daemon is already active

deprecatedmethod

stop() -> None

Stop the daemon and cleanup resources.

Automatically unlinks any linked filespaces before stopping. Cleans up operational files based on storage configuration:

  • SANDBOXED mode: Always cleans up temp directory
  • PHYSICAL mode: Cleans up if persist_on_exit=False

Safe to call multiple times - subsequent calls are no-ops.

Raises

Exception

Condition

DaemonError

If daemon stop fails

Condition

If daemon stop fails