Skip to main content

Official Python client for the Systems Capital API — US equity price history and quantitative statistics.

Project description

systemsdata

Official Python client for the Systems Capital API — US equity close-price history and quantitative return statistics for 2,600+ tickers, updated every trading day.


Install

pip install systemsdata

Optional pandas support:

pip install systemsdata[pandas]

Quick start

1 — Get an API key

python -m systemsdata setup

This opens the signup/dashboard URL, then asks you to paste your key. The key is stored in ~/.systemsdata/config.json and loaded automatically on every subsequent import.

Alternatively, set the environment variable:

export SYSTEMSDATA_API_KEY="sc_live_..."

Or authenticate inline:

import systemsdata as sd
sd.auth("sc_live_...")

2 — Fetch statistics

import systemsdata as sd

# 3-month kurtosis for AAPL (most recent data point)
result = sd.stats("AAPL", range="3m", metrics=["kurtosis"])
print(result.metrics["kurtosis"])   # → 1.2347

# All metrics, 1-year range, 3-month trailing window
result = sd.stats("NVDA", range="1y", window="3m")
print(result)
# StatsResult(
#   symbol='NVDA', window='3m',
#   period=2024-03-14 → 2025-03-14 (252 pts)
#   metrics:
#   avg_return: 0.1823
#   std_dev: 3.2841
#   kurtosis: 2.9103
#   ...
# )

3 — Fetch price history

prices = sd.prices("AAPL", range="1y")
print(prices.end_date, prices.points[-1].close)  # → 2025-03-14  214.37

# pandas DataFrame (requires systemsdata[pandas])
df = prices.to_dataframe()
print(df.tail())

API reference

sd.auth(api_key)

Set the API key for the current session. Not needed if SYSTEMSDATA_API_KEY is set or if you ran python -m systemsdata setup.


sd.stats(symbol, *, range, from_date, to_date, metrics, window) → StatsResult

Compute quantitative return statistics at the most recent data point.

Parameter Type Default Description
symbol str required Ticker, e.g. "AAPL"
range str "3m" "1w" | "1m" | "3m" | "1y" | "all"
from_date str | None None Custom start YYYY-MM-DD
to_date str | None None Custom end YYYY-MM-DD
metrics list[str] | None all Subset to compute
window str "period" Trailing calc window (see below)

Valid metrics keys: avg_return, std_dev, median, mode, min, max, skewness, kurtosis, annualized_return, price_slope

Valid window values: "period" (entire range), "1d", "1w", "1m", "3m", "6m", "1y", "2y", "5y"

range controls which price data is loaded; window controls the trailing slice used in each calculation. Example: range="1y", window="3m" loads one year of data but computes stats using only the last 3 months.


sd.prices(symbol, *, range, from_date, to_date) → PriceHistory

Fetch daily close-price history.

h = sd.prices("MSFT", range="6m")
h.points       # list[PricePoint(date, close)]
h.to_dicts()   # list[{"date": ..., "close": ...}]
h.to_dataframe()  # pandas DataFrame with DatetimeIndex

Credit model

Action Cost
1 data point (date + close) 2 credits
1 metric value 1 credit

Monthly bucket caching: loading the same symbol/month twice costs credits only on the first load. Free tier: 5,000 credits/month (signed-in) or 500 (anonymous).


Error handling

from systemsdata import AuthError, QuotaError, NotFoundError

try:
    result = sd.stats("AAPL", range="3m")
except AuthError:
    print("Invalid or missing API key")
except QuotaError as e:
    print(f"Out of credits — upgrade at {e.upgrade_url}")
except NotFoundError:
    print("Symbol not found")

CLI

python -m systemsdata setup   # interactive key setup
python -m systemsdata info    # show active key and config
python -m systemsdata test    # smoke-test with a live API call

LLM / agent usage

The API ships an OpenAPI 3.1 spec at:

https://www.systemscapital.net/api/v1/openapi

LLM agents can register the two endpoints (/data, /stats) as tools and pass the API key via the Authorization: Bearer sc_live_... header.


License

MIT

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

systemsdata-0.1.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

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

systemsdata-0.1.0-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: systemsdata-0.1.0.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for systemsdata-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6aba8dcc9bf87723e2ad3d7ac250eee9a40895b4aacbc6f6bfe8ca99ccd2d236
MD5 543bc3d9af3383f43f4c79ee10b3a560
BLAKE2b-256 b2103a677650e2b11064328e9e2579e68c6e65de8a44fb17b84ebae79b7c8c58

See more details on using hashes here.

File details

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

File metadata

  • Download URL: systemsdata-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for systemsdata-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8b1c4968c7d43a41b2d54b5633047caaefc8b980b3b5c060a7809d3ae8672804
MD5 28c6beeffd89985381eb6aed31f84896
BLAKE2b-256 f7352e05f46d8cdee169a303296820f35b22f143c6c850ea50f5c9d528047b94

See more details on using hashes here.

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