Python SDK
Install
Section titled “Install”pip install therminal-py # core (returns dicts)pip install therminal-py[pandas] # + DataFrame + Parquet supportpip install therminal-py[cli] # + CLI toolRequires Python 3.10+. Published on PyPI.
Quick example
Section titled “Quick example”from therminal import TherminalClient
client = TherminalClient()
# Get candles as JSON (list of dicts)candles = client.candles(market="KXHIGHNY-26MAR20-T50", from_date="2026-03-01")
# As a Pandas DataFramedf = client.candles( market="KXHIGHNY-26MAR20-T50", from_date="2026-03-01", as_dataframe=True,)
# Weather observations in metricobs = client.observations(station="NYC", units="metric", as_dataframe=True)Export formats
Section titled “Export formats”All data methods (candles, observations, climate) support format and columns:
# Save as CSV with specific columnspath = client.observations( station="NYC", from_date="2024-01-01", to_date="2024-12-31", format="csv", columns=["observed_at", "temp_f", "wind_speed_kt"], save_path="nyc_2024.csv",)
# Save as Parquetpath = client.candles( market="KXHIGHNY-26MAR20-T50", format="parquet", save_path="candles.parquet",)
# Parquet directly into DataFramedf = client.observations( station="NYC", format="parquet", as_dataframe=True,)| Parameter | Type | Description |
|---|---|---|
format | str | None (JSON default), "csv", "parquet" |
columns | list | Column names to include (e.g., ["temp_f", "wind_speed_kt"]) |
save_path | str/Path | File path for CSV/Parquet output |
as_dataframe | bool | Return Pandas DataFrame (JSON or load saved Parquet) |
therminal healththerminal series --limit 5therminal candles KXHIGHNY-26MAR20-T50 --from 2026-03-01 --limit 10therminal observations NYC --units metrictherminal climate NYC --from 2026-03-15 --to 2026-03-20Error handling
Section titled “Error handling”from therminal import TherminalClient, NotFoundError, RateLimitErrorimport time
client = TherminalClient()
try: data = client.series_detail("NONEXISTENT")except NotFoundError: print("Not found")except RateLimitError as e: time.sleep(e.retry_after)