Python SDK for Therminal — Kalshi temperature prediction markets + NWS weather data
Project description
therminal-py
Python SDK for Therminal — Kalshi temperature prediction markets + NWS weather data.
Install
pip install therminal-py # core (returns dicts)
pip install therminal-py[pandas] # + DataFrame support
pip install therminal-py[ml] # + scikit-learn ML features
pip install therminal-py[cli] # + CLI tool
pip install therminal-py[all] # pandas + ml + cli
Quick Start
from therminal import TherminalClient
client = TherminalClient()
# Get candles as a Pandas DataFrame
df = client.candles(
market="KXHIGHNY-26MAR20-T50",
from_date="2026-03-01",
interval=5,
as_dataframe=True,
)
# Get NYC weather observations in metric units
obs = client.observations(station="NYC", units="metric", limit=10)
# Get 1-minute ASOS observations (integer °C)
omo = client.observations(station="ATL", resolution="1min", from_date="2025-01-01", limit=100)
ML Features (scikit-learn)
pip install therminal-py[ml]
from therminal.ml import WeatherFeatures
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.ensemble import GradientBoostingRegressor
# WeatherFeatures is a scikit-learn Transformer
# Input: dates → Output: feature matrix (X)
# Target (y) is your responsibility
pipe = make_pipeline(
WeatherFeatures(station="ATL", sources=["omo", "metar"], lookback_hours=24),
StandardScaler(),
GradientBoostingRegressor(),
)
pipe.fit(dates_train, y_train)
pipe.predict(dates_test)
# Configurable: sources, lookback window, aggregations, calendar features
wf = WeatherFeatures(
station="ATL",
sources=["omo", "metar"],
lookback_hours=48,
omo_aggs=("min", "max", "mean", "std", "range"),
include_calendar=True,
)
X = wf.fit_transform(dates)
wf.get_feature_names_out() # ['omo_temp_c_mean_48h', 'metar_temp_f_last_48h', ...]
Documentation
Full API reference with interactive playground: docs.mostlyright.xyz
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
therminal_py-0.5.0.tar.gz
(23.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 therminal_py-0.5.0.tar.gz.
File metadata
- Download URL: therminal_py-0.5.0.tar.gz
- Upload date:
- Size: 23.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
870fb513c8c08b43f11e9494aeeb42cc76512afd9f7a51050de04af28e4784a0
|
|
| MD5 |
7d5a86507f3e89488baeede418c3a7a2
|
|
| BLAKE2b-256 |
09b856730c00117212207b86650b8ddb8aaccb82e34811c699dfad426594bdc0
|
File details
Details for the file therminal_py-0.5.0-py3-none-any.whl.
File metadata
- Download URL: therminal_py-0.5.0-py3-none-any.whl
- Upload date:
- Size: 20.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd96c8ca1753fc05d110e071ccd86fa16fe91d1e4fc293bcc879ce0756cefa6d
|
|
| MD5 |
cbdc55e163edd8e517f69142a7add7bb
|
|
| BLAKE2b-256 |
a26d51c290778fae09523d3879bff1fbfeb43be026835b9f394e995abcbc1e99
|