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.1.tar.gz (11.6 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.1-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: epsilab-0.1.1.tar.gz
  • Upload date:
  • Size: 11.6 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.1.tar.gz
Algorithm Hash digest
SHA256 a693b24e2933b1a3dee9c2566b88f444bdcad4a50f9af66d02f25adec56e8c3c
MD5 085290edef907660c999e4ea84660726
BLAKE2b-256 6a2085067b697bf7fcaea1c9766c3f397f0958b15adee339e061f90f22bbe63b

See more details on using hashes here.

Provenance

The following attestation bundles were made for epsilab-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: epsilab-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e56df5c1a44de2884fe54840bb1039964e580aadb7dcb8ac85176b7225489a9c
MD5 2b4392260f50f73318b4d22ab52141b4
BLAKE2b-256 181f58eebd54cfc3643454065c3d395be7f6cfff47cfb0c74e0c7c62af69ccc1

See more details on using hashes here.

Provenance

The following attestation bundles were made for epsilab-0.1.1-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