Skip to main content

Python SDK for Epsilab live portfolio data (signals, weights, trades).

Project description

Epsilab Python SDK

Minimal Python client and CLI for the Epsilab Website API (pass-through to Strategy-Engine). Auth uses an API key.

Install

pip install epsilab

Install from source

cd /home/matthew/Epsilab/Epsilab-API
python -m venv .venv && source .venv/bin/activate
pip install --upgrade pip
pip install .
# or for development
pip install -e .

Environment

Set these variables or pass explicitly to the client:

  • EPSILAB_API_BASE (default https://www.epsilab.ai/api/ext/v1)
  • EPSILAB_API_KEY (a user API key created in Account Settings)

Note:

  • API access requires an active Pro subscription. Requests from accounts without Pro will be rejected.
  • Live endpoints are rate limited (e.g., ~1 request/second sustained with small bursts). Excessive requests will receive HTTP 429.
  • Use nextEtaMin from get_live_status() to poll intelligently. For example, if nextEtaMin=80.07, you can sleep ~80 minutes before the next refresh instead of tight-loop polling. The results will be the same.

Python Usage

from epsilab import Epsilab

client = Epsilab(api_base="https://www.epsilab.ai/api/ext/v1", api_key="<epsk_live_...>")

# Note: Running the portfolio via API key is disabled. Use the website to initiate runs.

# Fetch live data (typed models)
latest = client.get_live_latest(return_results_if_fresh=True)          # epsilab.models.LiveLatest
status = client.get_live_status()                                      # epsilab.models.LiveStatus
signals = client.get_portfolio_signals(limit=500)                      # List[epsilab.models.PortfolioSignal]
weights = client.get_portfolio_weights(limit=500)                      # List[epsilab.models.PortfolioWeight]
trades = client.get_live_trades(status="PENDING,EXECUTED", include_positions=True)  # List[epsilab.models.PortfolioTrade]
equity = client.get_live_equity(limit=200)                             # List[epsilab.models.EquityPoint]

print(latest)

CLI Usage

# Set API key in env
export EPSILAB_API_KEY="<epsk_live_...>"

Data models

  • get_live_latest()LiveLatest with fields:

    • run_id: Optional[str]
    • timeframe: Optional[str]
    • signals: List[PortfolioSignal]
    • weights: List[PortfolioWeight]
    • fresh: Optional[bool]
    • recomputed: Optional[bool]
  • get_live_status()LiveStatus with fields:

    • latest_run_id: Optional[str]
    • timeframe: Optional[str]
    • next_eta_minutes: Optional[float]
    • counts: Dict[str, int]
  • get_portfolio_signals()List[PortfolioSignal] with fields:

    • symbol: str, signal_type: str, strength: Optional[float], timestamp: Optional[str], date: Optional[str]
  • get_portfolio_weights()List[PortfolioWeight] with fields:

    • symbol: str, final_weight: Optional[float], raw_weight: Optional[float], timestamp: Optional[str], date: Optional[str]
  • get_live_trades()List[PortfolioTrade] with fields:

    • id: str, symbol: str, side: str, qty: Optional[float], planned_price: Optional[float], planned_at: Optional[str], status: str, reasoning: Optional[str]
  • get_live_members()List[PortfolioMember] with fields:

    • strategy_id: str, effective_weight: Optional[float], name: Optional[str], visibility: Optional[str]
  • get_live_equity()List[EquityPoint] with fields:

    • date: str, value: float

All models expose to_dict(), to_json(), and log() helpers for convenient logging.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

epsilab-0.1.0.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

epsilab-0.1.0-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

Details for the file epsilab-0.1.0.tar.gz.

File metadata

  • Download URL: epsilab-0.1.0.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for epsilab-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ed3eb94770a65fbd59d9aaf127f73cc721254e45b13d1acc91a51de0599b4220
MD5 4c63e56f28001bb490c00efc46f2c2f6
BLAKE2b-256 7527c4013007fde300e632fff43870b1d294bad23f53dddcda488e96b25e1451

See more details on using hashes here.

Provenance

The following attestation bundles were made for epsilab-0.1.0.tar.gz:

Publisher: workflow.yml on EpsilabAI/epsilab-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file epsilab-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: epsilab-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 22.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for epsilab-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 697084cfda00a4e161c92541f9ee531678c339f647d7a9c87ab6e44af1487dc9
MD5 d2588552ab663bac840170de959deafa
BLAKE2b-256 86403eba6885f812badd2781d0b0d7618250514c2e072435e5541d11652d1d43

See more details on using hashes here.

Provenance

The following attestation bundles were made for epsilab-0.1.0-py3-none-any.whl:

Publisher: workflow.yml on EpsilabAI/epsilab-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page