Skip to main content

therminal-py

Python SDK for Therminal — Kalshi temperature prediction markets + NWS weather data + real-time METAR signaling.

Install

pip install therminal-py            # core
pip install therminal-py[pandas]    # + DataFrame + Parquet support
pip install therminal-py[ml]        # + scikit-learn ML features
pip install therminal-py[torch]     # + PyTorch Dataset
pip install therminal-py[cli]       # + CLI tool
pip install therminal-py[all]       # pandas + ml + cli

Requires Python 3.11+.

Quick Start

from therminal.weather import WeatherHistory, WeatherLive
from therminal.markets import MarketsClient

# Historical observations (via therminal-api)
weather = WeatherHistory()
obs = weather.observations(station="NYC", units="metric", as_dataframe=True)

# Live METAR (direct from AWC — same Observation schema as historical)
live = WeatherLive()
current = live.current("NYC")
print(current[0].temp_f)

# Batch: one AWC request for multiple stations
batch = live.current(["NYC", "ATL", "MDW", "LAX"])

# Market candles
markets = MarketsClient()
df = markets.candles(market="KXHIGHNY-26MAR20-T50", from_date="2026-03-01", as_dataframe=True)

Backward compatible: from therminal import TherminalClient still works. WeatherClient and LiveClient are aliases for WeatherHistory and WeatherLive.

Configuration

Create ~/.therminal.toml for sensible defaults:

[defaults]
units = "metric"
station = "NYC"

[api]
base_url = "https://api.mostlyright.xyz"

Resolution order: file < env vars (THERMINAL_UNITS, THERMINAL_TZ, THERMINAL_STATION) < per-call kwargs.

Live METAR (AWC Direct)

WeatherLive fetches real-time METAR from the Aviation Weather Center. Returns Observation objects identical in schema to WeatherHistory.observations(), eliminating train/serve skew for trading signals.

from therminal.weather import WeatherLive

live = WeatherLive()
obs = live.current(["NYC", "ATL"])         # batch: one request
history = live.latest("NYC", hours=3)      # last 3 hours
metric = live.current("NYC", units="metric")  # with conversion

ML Features (scikit-learn)

pip install therminal-py[ml]
from therminal.ml import WeatherFeatures, LOBFeatures
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.ensemble import GradientBoostingRegressor

pipe = make_pipeline(
    WeatherFeatures(station="ATL", sources=["omo", "metar"], lookback_hours=24),
    StandardScaler(),
    GradientBoostingRegressor(),
)
pipe.fit(dates_train, y_train)
pipe.predict(dates_test)

Typed Models

All responses return frozen dataclasses with both attribute and dict-style access:

obs = weather.observations(station="NYC")[0]
obs.temp_f          # attribute access
obs["temp_f"]       # dict access (backward compat)
obs.get("temp_f")   # .get() with default
obs.to_dict()       # full dict with all 29 fields

Documentation

Full API reference with interactive playground: docs.mostlyright.xyz

Metadata

Release files for therminal-py 1.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for therminal-py 1.0.8
File Size Uploaded
therminal_py-1.0.8.tar.gz 58.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for therminal-py 1.0.8
File Interpreter ABI Platform
therminal_py-1.0.8-py3-none-any.whl Python 3 none any Details

Total release size: 99.1 kB

Release files / therminal_py-1.0.8.tar.gz

Download URL therminal_py-1.0.8.tar.gz
Size 58.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4eac1f1b78f2bdda11e6ea4d80bfef590e39ce793a80be7fb0b82b1d7948c229
BLAKE2b-256 checksum
How to use checksums
3c12d48848a43a1809bbfe8b91657c92c623f80c974aecd13124cd7c7e14eb6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 31, 2026.

Transparency log

Release files / therminal_py-1.0.8-py3-none-any.whl

Download URL therminal_py-1.0.8-py3-none-any.whl
Size 40.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a9f97e20b1ef6397d3f47b5c4368f9119738a14e1aff4b79a99cf9dced5aaf96
BLAKE2b-256 checksum
How to use checksums
596053738d3b0280264461bed05a0fa3d645bf3a44bea2a7c35590fd61afeecd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 31, 2026.

Transparency log

Release history Release notifications | RSS feed

1.0.9

2 release files

This release

1.0.8 This release

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.5.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page