daemon
LucidLink Python Library - Daemon Management
High-level Pythonic wrapper for the LucidLink daemon. Provides context manager support for daemon lifecycle management.
lucidlink.daemon.Daemon
This API is deprecated.
Daemon(config: Optional[Dict[str, str]] = None, storage: Optional[StorageConfig] = None)Parameter | 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 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()
authenticate(credentials: ServiceAccountCredentials) -> Workspace
Authenticate to LucidLink using service account credentials.
Must call start() before authenticate().
Parameters
Parameter | Description |
|---|---|
| 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 |
|---|---|
If daemon is not started | |
If authentication fails | |
| If credentials are invalid |
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)
is_running() -> bool
Check if the daemon is currently running.
Returns
True if daemon is started, False otherwise
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 |
|---|---|
If daemon start fails or another daemon is already active |
stop() -> None
Stop the daemon and cleanup resources.
Automatically unlinks any linked filespaces before stopping. Cleans up operational files based on storage configuration:
SANDBOXEDmode: Always cleans up temp directoryPHYSICALmode: Cleans up ifpersist_on_exit=False
Safe to call multiple times - subsequent calls are no-ops.
Raises
Exception | Condition |
|---|---|
If daemon stop fails |