Configuration
Configure the Lightwheel SDK using environment variables, programmatic settings, or configuration files.
Environment Variables
API Configuration
# Set API endpoint (default: https://api.lightwheel.net)
export LW_API_ENDPOINT="https://api.lightwheel.net"
Authentication
# Set credentials via environment
export LoaderUserName="your_username"
export LoaderToken="your_access_token"
Logging
# Set log level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
export LW_SDK_LOG_LEVEL="INFO"
# Set log file path
export LW_SDK_LOG_FILE="/var/log/lightwheel/sdk.log"
Custom Headers
# Add custom headers to all requests
export LW_SDK_HEADERS_X_CUSTOM_HEADER="custom_value"
export LW_SDK_HEADERS_X_API_KEY="api_key_value"
# Headers are automatically converted:
# LW_SDK_HEADERS_X_CUSTOM_HEADER -> x-custom-header
Programmatic Configuration
Client Configuration
from lightwheel_sdk.loader import LightwheelClient
# Basic configuration
client = LightwheelClient(
host="https://api.lightwheel.net",
base_timeout=30 # 30 seconds timeout
)
# Custom headers
client._update_header("X-Custom-Header", "value")
Logger Configuration
from lightwheel_sdk.logger import setup_logger
# Configure logger
logger = setup_logger(
name="my_app",
level="DEBUG",
log_file="/var/log/my_app.log",
format_string="[%(levelname)s] %(asctime)s - %(message)s"
)
Cache Configuration
Cache Locations
The SDK uses the following cache directories:
~/.cache/lightwheel_sdk/
├── login/ # Authentication cache
│ └── account.json
├── object/ # Downloaded objects
│ └── object_name/
├── floorplan/ # Downloaded floorplans
│ ├── robocasa-robocasakitchen-1-1/
│ └── usd_version.json
└── scene/ # Scene cache (if applicable)
Timeout Configuration
Default Timeouts
from lightwheel_sdk.loader import LightwheelClient
# Set base timeout for all requests
client = LightwheelClient(
host="https://api.lightwheel.net",
base_timeout=30 # 30 seconds
)
Floorplan Download Timeout
from concurrent.futures import TimeoutError
future = floorplan_loader.acquire_usd(
scene="robocasakitchen",
layout_id=1,
style_id=1
)
try:
# Wait max 10 minutes
usd_path, metadata = future.result(timeout=600)
except TimeoutError:
print("Download timed out")