Reference

Environment setup

Local environment variables, credentials, and package extras for hosted AlphaLens workflows.

Keep secrets in your shell, .env, or .env.local. alphalens-core loads local env files automatically.

AlphaLens

bash
ALPHALENS_API_KEY=alens_...

Create this in Dashboard → Settings → API Keys.

Use the key to:

  • Mint authenticated cloud sessions.
  • Sync backtest data.
  • Access AlphaLens-hosted market data endpoints.
  • Emit live deployment telemetry.

Alpaca

bash
ALPACA_API_KEY=...
ALPACA_SECRET_KEY=...
ALPACA_PAPER=true

The live runner defaults to paper trading from the CLI. Use --live only when you want live Alpaca routing.

Package extras

ExtraUse
liveAlpaca live runner and market data polling dependencies
cloudSupabase sync client
fastFaster parquet-backed cache when pyarrow is available
vizLocal report/dashboard dependencies
polygonDirect Polygon data source outside the hosted AlphaLens path

Recommended hosted install:

bash
pip install "alphalens-core[live,cloud,fast]"

Local files

Common runtime paths:

PathUse
.alphalens/cacheLocal OHLCV cache
.alphalens/live/<strategy>.jsonLive runner checkpoint
~/.alphalens/supabase_session.jsonCached AlphaLens session from alphalens connect