The Lume Python SDK is designed to be simple and intuitive. The API is centered around a few core functions and a primary data object, LumeRun.

This reference is divided into the following sections:

  • Functions: Top-level functions like lume.run() for interacting with the Lume platform.
  • Classes: Core data objects, primarily the LumeRun object that represents a pipeline execution.
  • Exceptions: Custom exceptions raised by the SDK for specific error conditions.

Authentication

The SDK authenticates automatically by reading the LUME_API_KEY from your environment variables. You can also initialize the client explicitly using the lume.init() function, which is useful in environments where you cannot set environment variables.

Basic Workflow

The most common workflow involves two primary steps:

  1. Calling lume.run() to trigger a new pipeline.
  2. Using the returned LumeRun object to monitor the execution, either by blocking with run.wait() or by periodically checking its status.
import lume

# Trigger a run
run = lume.run(
    flow_version="my-flow:v1", 
    source_path="unique-batch-id-123"
)

# Wait for it to complete
run.wait()

# Check the final status
print(f"Run {run.id} finished with status: {run.status}")