Metadata-Version: 2.4
Name: therminal-py
Version: 0.5.0
Summary: Python SDK for Therminal — Kalshi temperature prediction markets + NWS weather data
Project-URL: Homepage, https://github.com/Tarabcak/therminal-py
Project-URL: API, https://api.mostlyright.xyz
Author: Tarabcak
License-Expression: MIT
Keywords: METAR,OHLCV,kalshi,prediction-markets,trading,weather
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27
Provides-Extra: all
Requires-Dist: numpy>=1.24; extra == 'all'
Requires-Dist: pandas>=2.0; extra == 'all'
Requires-Dist: pyarrow>=15.0; extra == 'all'
Requires-Dist: rich>=13.0; extra == 'all'
Requires-Dist: scikit-learn>=1.3; extra == 'all'
Requires-Dist: typer>=0.12; extra == 'all'
Provides-Extra: cli
Requires-Dist: rich>=13.0; extra == 'cli'
Requires-Dist: typer>=0.12; extra == 'cli'
Provides-Extra: dev
Requires-Dist: numpy>=1.24; extra == 'dev'
Requires-Dist: pandas>=2.0; extra == 'dev'
Requires-Dist: pyarrow>=15.0; extra == 'dev'
Requires-Dist: pytest-httpx>=0.35; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: rich>=13.0; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Requires-Dist: scikit-learn>=1.3; extra == 'dev'
Requires-Dist: typer>=0.12; extra == 'dev'
Provides-Extra: ml
Requires-Dist: numpy>=1.24; extra == 'ml'
Requires-Dist: scikit-learn>=1.3; extra == 'ml'
Provides-Extra: pandas
Requires-Dist: pandas>=2.0; extra == 'pandas'
Requires-Dist: pyarrow>=15.0; extra == 'pandas'
Provides-Extra: torch
Requires-Dist: numpy>=1.24; extra == 'torch'
Requires-Dist: torch>=2.0; extra == 'torch'
Description-Content-Type: text/markdown

# therminal-py

Python SDK for [Therminal](https://api.mostlyright.xyz) — Kalshi temperature prediction markets + NWS weather data.

## Install

```bash
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

```python
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)

```bash
pip install therminal-py[ml]
```

```python
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](https://docs.mostlyright.xyz)**
