Python SDK for Epsilab live portfolio data (signals, weights, trades).
Project description
Epsilab Python SDK
Official Python SDK for accessing Epsilab live portfolio data (signals, weights, trades, equity) using an API key.
Install
pip install epsilab
If you want HTTP/2 for faster connections, install with:
pip install "httpx[http2]"
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(defaulthttps://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
nextEtaMinfromget_live_status()to poll intelligently. For example, ifnextEtaMin=80.07, you can sleep ~80 minutes before the next refresh instead of tight-loop polling. The results will be the same.
Set API key in your shell (bash/zsh):
export EPSILAB_API_KEY="<epsk_live_...>"
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)
Examples
See examples/example.py for a short polling example that prints summary data every few seconds.
Data models
-
get_live_latest()→LiveLatestwith fields:run_id: Optional[str]timeframe: Optional[str]signals: List[PortfolioSignal]weights: List[PortfolioWeight]fresh: Optional[bool]recomputed: Optional[bool]
-
get_live_status()→LiveStatuswith fields:latest_run_id: Optional[str]timeframe: Optional[str](tf denotes the rebalancing frequency; e.g.,tf=4hmeans the portfolio is updated on a 4-hour cadence, based on the most granular timeframe among strategies in the portfolio)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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file epsilab-0.1.3.tar.gz.
File metadata
- Download URL: epsilab-0.1.3.tar.gz
- Upload date:
- Size: 11.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
822753f8ec5e93c4480e2fb0d78728f1b3344bfae8d336f2ce5be3a3f535d7fc
|
|
| MD5 |
ce933010c070b6cd81cfc73756dff1cf
|
|
| BLAKE2b-256 |
f07b8b8ce06c029756669443761e94ce1f6a74693047c7d62b451eb37ada2194
|
Provenance
The following attestation bundles were made for epsilab-0.1.3.tar.gz:
Publisher:
workflow.yml on EpsilabAI/epsilab-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
epsilab-0.1.3.tar.gz -
Subject digest:
822753f8ec5e93c4480e2fb0d78728f1b3344bfae8d336f2ce5be3a3f535d7fc - Sigstore transparency entry: 495325507
- Sigstore integration time:
-
Permalink:
EpsilabAI/epsilab-python@2b1686236d9a76e22ee09adb070f66bce0b0c3f7 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/EpsilabAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@2b1686236d9a76e22ee09adb070f66bce0b0c3f7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file epsilab-0.1.3-py3-none-any.whl.
File metadata
- Download URL: epsilab-0.1.3-py3-none-any.whl
- Upload date:
- Size: 22.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93ae1e097dc522620569efc24e2df15340bf01428d30cebef328abc9b734cc2e
|
|
| MD5 |
a1dd668f0802749676957afb1a70ee24
|
|
| BLAKE2b-256 |
4ff3fa2d221d6003731019bd8f0a174e4c0eaeb45da7c2c2041e9643179dee59
|
Provenance
The following attestation bundles were made for epsilab-0.1.3-py3-none-any.whl:
Publisher:
workflow.yml on EpsilabAI/epsilab-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
epsilab-0.1.3-py3-none-any.whl -
Subject digest:
93ae1e097dc522620569efc24e2df15340bf01428d30cebef328abc9b734cc2e - Sigstore transparency entry: 495325522
- Sigstore integration time:
-
Permalink:
EpsilabAI/epsilab-python@2b1686236d9a76e22ee09adb070f66bce0b0c3f7 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/EpsilabAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@2b1686236d9a76e22ee09adb070f66bce0b0c3f7 -
Trigger Event:
push
-
Statement type: