Python SDK for the Options Analysis Suite API: 17 pricing models, auto-calibration, GEX/DEX exposure, IV surfaces, and pre-computed market data.
Project description
Options Analysis Suite — Python SDK
Type-safe Python client for the Options Analysis Suite API.
Status: alpha (
0.1.0a1) — full coverage of every typed/v1/*operationId, plus aCalibrationdomain helper. Drift-checked against the deployed OpenAPI spec.
Install
pip install options-analysis-suite
Available on PyPI after the first
v*tag is published. Until then, install from source withpip install -e .from a repo checkout.
Quickstart
from oas import OASClient, TradierCredentials
with OASClient(api_key="oas_live_...") as client:
# Data: cached EOD analytics
snap = client.snapshot("SPY")
print(snap.atmIv, snap.netGex, snap.maxPain)
if snap.maxPainCurve:
for row in snap.maxPainCurve:
print(row.strike, row.totalPain)
# Compute: 17 pricing models, full Greeks, exposure, expected move...
price = client.price(model="bs", is_call=True, S=650, K=650, r=0.05,
q=0.012, sigma=0.15, t=0.25)
greeks = client.greeks(model="heston", is_call=True, S=650, K=650, r=0.05,
q=0.012, sigma=0.15, t=0.25)
# Calibrate once, persist, reuse — never re-touches the calibrationId TTL.
cal = client.calibrate(
"SPY", model="heston",
broker=TradierCredentials(token="..."),
)
cal.save("spy_heston.json")
# Evaluate the calibrated model anywhere across the chain.
fair = cal.price(is_call=True, K=655, expiry="2026-06-19")
# Stream batched metrics without manually paging.
for m in client.iter_metrics(["SPY", "QQQ", "IWM", "DIA"], batch_size=50):
print(m.symbol, m.ivRank)
Calibration round-trip
A Calibration is the durable wrapper around a /v1/compute/calibrate result.
The fitted params dict survives a JSON round-trip; the 30-second-only
calibrationId is intentionally not surfaced.
# Load a saved calibration in another process / hours later.
from oas import Calibration, OASClient
cal = Calibration.from_json("spy_heston.json")
with OASClient(api_key="oas_live_...") as client:
cal.bind(client) # attach so cal.price() / cal.greeks() can fire HTTP
price = cal.price(is_call=True, K=650, S=650, r=0.05, q=0.012,
sigma=0.15, t=0.25)
Errors
Every error subclass carries the HTTP status, the server's structured code
field (when present), and any extra fields the server returned.
from oas.errors import NotFoundError, RateLimitError, CalibrationQuotaError
try:
snap = client.snapshot("UNKNOWN")
except NotFoundError as e:
print(f"warehouse miss: {e}")
except RateLimitError as e:
print(f"slow down — retry in {e.retry_after}s (bucket: {e.bucket})")
except CalibrationQuotaError as e:
print(f"calibration quota exhausted; resets at {e.resets_at}")
See src/oas/errors.py for the full hierarchy.
Models
Response models live in oas._generated.models and are auto-generated from
the OpenAPI spec at build time. The generated classes use extra='ignore'
so additive server fields (e.g., a new metric in MetricsResponse) don't
break older SDK versions — older SDKs will simply omit unknown fields.
To regenerate against the latest spec:
make gen
Development
# Set up dev env
make install
# Lint / typecheck / test
make lint
make typecheck
make test # unit + drift, no network. Uses tests/fixtures/openapi.snapshot.json
make test-live # integration (needs OAS_API_KEY env var). Also re-checks the
# pinned spec fixture against the deployed /openapi.json.
# Refresh the fixture with:
# curl -s https://data.optionsanalysissuite.com/openapi.json \
# > tests/fixtures/openapi.snapshot.json
# Build distribution
make build
Drift gate
The SDK's _manifest.py registers every operationId → OASClient method
pairing. tests/test_drift.py runs four checks against the spec:
- Every
ENDPOINTSoperationId actually exists in/openapi.json - Every registered
Endpoint.sdk_methodresolves to a realOASClientattr - Every registered
Endpoint.pathis a path in the spec - Strict gate: spec ops − ignored − expected-missing ==
ENDPOINTSkeys. Catches both unfinished stubs left in the allowlist and surprise spec additions.
The EXPECTED_MISSING_OPERATION_IDS allowlist is empty — the SDK
covers every typed operation. The live test suite double-checks that
the pinned tests/fixtures/openapi.snapshot.json still matches deployed
prod.
Release process (maintainers)
Releases are tag-driven via the publish.yml GitHub Actions workflow.
The publish job uses PyPI Trusted Publishing
(OIDC) — no API tokens are stored anywhere.
One-time setup (on PyPI):
- Visit https://pypi.org/manage/account/publishing/
- Add a pending publisher with:
- Owner:
Options-Analysis-Suite - Repository:
options-analysis-suite-python - Workflow filename:
publish.yml - Environment:
pypi
- Owner:
- (After the first publish, the project will exist on PyPI and the pending publisher becomes a regular trusted publisher.)
One-time setup (on GitHub):
The publish job runs in a GitHub environment named pypi (see
environment: pypi in publish.yml). Create it under Settings →
Environments → New environment. Optional but recommended: require
manual approval, restrict to the main branch, and add reviewers so a
stray tag push can't ship to PyPI without a human in the loop.
Per-release:
- Bump
versioninpyproject.tomlto the new version (e.g.0.1.0a1→0.1.0). - Update
CHANGELOG.mdunder the new version heading; move[Unreleased]items into it. - Commit (
chore: release vX.Y.Z). - Tag the commit:
git tag vX.Y.Z(thevprefix is required — the publish workflow only triggers on tags matchingv*). - Push the tag:
git push origin vX.Y.Z.
The workflow:
- Verifies the tag's version matches
pyproject.toml - Runs lint + typecheck + offline tests
- Builds sdist + wheel via
uv build - Publishes to PyPI through the OIDC trusted publisher
If the tag-vs-pyproject guard fails, fix pyproject.toml, retag with
git tag -d + recreate, and re-push.
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
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 options_analysis_suite-0.1.0a1.tar.gz.
File metadata
- Download URL: options_analysis_suite-0.1.0a1.tar.gz
- Upload date:
- Size: 64.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dcbddac5f5a4265094183b7ed4d84dba5bdf18525e933d22e65c789da1d29396
|
|
| MD5 |
16a1f10d5682fa6b6c86d75c6eb08ced
|
|
| BLAKE2b-256 |
6dfd1859b52c94383d9fb010e55d8d7880eb3b0c11e9b770abfc6d26e25db3fa
|
Provenance
The following attestation bundles were made for options_analysis_suite-0.1.0a1.tar.gz:
Publisher:
publish.yml on Options-Analysis-Suite/options-analysis-suite-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
options_analysis_suite-0.1.0a1.tar.gz -
Subject digest:
dcbddac5f5a4265094183b7ed4d84dba5bdf18525e933d22e65c789da1d29396 - Sigstore transparency entry: 1399457739
- Sigstore integration time:
-
Permalink:
Options-Analysis-Suite/options-analysis-suite-python@abe014b37a1d2fbf8ff7ab89890c8e7f706d326a -
Branch / Tag:
refs/tags/v0.1.0a1 - Owner: https://github.com/Options-Analysis-Suite
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@abe014b37a1d2fbf8ff7ab89890c8e7f706d326a -
Trigger Event:
push
-
Statement type:
File details
Details for the file options_analysis_suite-0.1.0a1-py3-none-any.whl.
File metadata
- Download URL: options_analysis_suite-0.1.0a1-py3-none-any.whl
- Upload date:
- Size: 28.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ba81aa78b3235fce27752b9fdaf5fefe7ed1a5d4f6df000ce79a53af8481343
|
|
| MD5 |
84ab811fbeb95edb1453c7b2310eca58
|
|
| BLAKE2b-256 |
4e15258c465c77b3f30d65c4fde45e7bc6d7df99f2a67aaededfa38757c8c5f2
|
Provenance
The following attestation bundles were made for options_analysis_suite-0.1.0a1-py3-none-any.whl:
Publisher:
publish.yml on Options-Analysis-Suite/options-analysis-suite-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
options_analysis_suite-0.1.0a1-py3-none-any.whl -
Subject digest:
4ba81aa78b3235fce27752b9fdaf5fefe7ed1a5d4f6df000ce79a53af8481343 - Sigstore transparency entry: 1399457751
- Sigstore integration time:
-
Permalink:
Options-Analysis-Suite/options-analysis-suite-python@abe014b37a1d2fbf8ff7ab89890c8e7f706d326a -
Branch / Tag:
refs/tags/v0.1.0a1 - Owner: https://github.com/Options-Analysis-Suite
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@abe014b37a1d2fbf8ff7ab89890c8e7f706d326a -
Trigger Event:
push
-
Statement type: