Skip to main content

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


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-1.0.0.tar.gz (45.2 kB view details)

Uploaded Source

Built Distribution

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

therminal_py-1.0.0-py3-none-any.whl (36.8 kB view details)

Uploaded Python 3

File details

Details for the file therminal_py-1.0.0.tar.gz.

File metadata

  • Download URL: therminal_py-1.0.0.tar.gz
  • Upload date:
  • Size: 45.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for therminal_py-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8388566093c0696032db6215c7ae2ece6753943245ca8a0f132cfc8642798c3c
MD5 2582b3612558bbe9919d04fa5ff88e7c
BLAKE2b-256 495f38f4bd782714ed07802c6702c0d67f103e5e310041035e3ef4b206bb7171

See more details on using hashes here.

Provenance

The following attestation bundles were made for therminal_py-1.0.0.tar.gz:

Publisher: publish.yml on Tarabcak/therminal-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file therminal_py-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: therminal_py-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 36.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for therminal_py-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4bd2389f6853c96e328edccd1b06dda0e718e026187107c229ce6f3084074f62
MD5 3694a51bf4badea121a5b64ab4227902
BLAKE2b-256 7c58ff97d4f372fc31fd8ed341ff2b3c37dec2cabc65dd9b63eba65c61fe6595

See more details on using hashes here.

Provenance

The following attestation bundles were made for therminal_py-1.0.0-py3-none-any.whl:

Publisher: publish.yml on Tarabcak/therminal-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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