Python client for the public Grand Thera AIT API.
Project description
thera-os
Python client for the public Grand Thera AIT API.
The package wraps the public API endpoints for:
- Neural SDE forecast:
POST /api/v1/forecast/run - Regime analysis:
POST /api/v1/regime/analyze - Regime dashboard scope:
POST /api/v1/regime/scope - Symbolic regression:
POST /api/v1/symbolic/fit - Symbolic prediction and scenarios
- Dataset/file upload endpoints
Install
pip install thera-os
For local development:
git clone https://github.com/GrandThera/thera-os-python.git
cd thera-os-python
python -m pip install -e ".[dev]"
pytest
Quick Start
from thera_os import TheraOSClient
client = TheraOSClient()
prices = [5.12, 5.15, 5.11, 5.18, 5.21]
forecast = client.forecast_run(
series=prices,
steps=30,
simulations=500,
targets=[prices[-1] * 1.05],
)
regime = client.regime_analyze(
prices=prices,
window=2,
n_regimes=2,
)
print(forecast["terminal_summary"])
print(regime["summary"])
By default the client uses:
https://api.thera-os.com/api/v1
Use another deployment by passing base_url:
client = TheraOSClient(base_url="http://localhost:8000/api/v1")
Upload Examples
from thera_os import TheraOSClient
client = TheraOSClient()
forecast = client.forecast_upload(
"usdbrl.csv",
steps=30,
simulations=1000,
targets=[5.60],
)
dataset = client.symbolic_upload(
"dataset.xlsx",
dependent="target",
independents=["x1", "x2"],
)
Error Handling
from thera_os import TheraOSAPIError, TheraOSClient
client = TheraOSClient()
try:
result = client.forecast_run(series=[1.0, 1.1, 1.2])
except TheraOSAPIError as exc:
print(exc.status_code)
print(exc.code)
print(exc.message)
Publishing Checklist
- Create a public GitHub repository, for example
GrandThera/thera-os-python. - Update the URLs in
pyproject.tomlif the repository name changes. - Confirm no private URLs, credentials, notebooks with secrets,
.venv,.git, caches, or backend internals are committed. - Run:
python -m pip install -e ".[dev]"
pytest
python -m build
- Publish when ready:
python -m twine upload dist/*
License
MIT
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
thera_os-0.1.0.tar.gz
(7.0 kB
view details)
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 thera_os-0.1.0.tar.gz.
File metadata
- Download URL: thera_os-0.1.0.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee9682a63db6eeb8b61e16fcf8e4e2a13c34a17bea19f7ba52ece3ece80f9328
|
|
| MD5 |
8e2e4228917f61bc35d268f996cbced9
|
|
| BLAKE2b-256 |
a1dd97443e575db50dc67dc6abb981e9dbeb33206b8f090432f7c12ba717595b
|
File details
Details for the file thera_os-0.1.0-py3-none-any.whl.
File metadata
- Download URL: thera_os-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
698b295c226786fccb31e7e3d0d88989b6bd3fbfdb5d4f2ae82d4d3c93e7d64f
|
|
| MD5 |
f53956c748fece454cdcdc2b3f35f5ed
|
|
| BLAKE2b-256 |
faab25e77b121d82393276d4f408f4fb7abdf1aad3ef761937f2cba29523cf2d
|