Weather · Public data

Daily weather

Temperature and rainfall by capital and day.

GHCN-Daily (NOAA National Centers for Environmental Information) · Public domain · commons_pubdata.weather.daily

Read Markdown
A year at the Madrid station: daily highs and lows (°C) and rain (bars).
A year at the Madrid station: daily highs and lows (°C) and rain (bars).

Query it with DuckDB.

Bash
lhbox duckdb --catalog commons/pubdata
SQL · Last week in Madrid
SELECT d.day, d.tmax_c, d.tmin_c, d.precipitation_mm
FROM commons_pubdata.weather.daily AS d JOIN commons_pubdata.weather.stations AS s USING (station_id)
WHERE s.capital_city = 'Madrid' AND d.day >= current_date - 7
ORDER BY d.day;

Read it where you work.

Public, read-only data. With an account, lhbox duckdb attaches the catalog as commons_pubdata; an agent with the LakehouseBox connector opens it with open_public_catalog("commons/pubdata"). Without one, DuckDB reads the public files directly.

Example queries

  • Last week in Madrid
    SELECT d.day, d.tmax_c, d.tmin_c, d.precipitation_mm
    FROM commons_pubdata.weather.daily AS d JOIN commons_pubdata.weather.stations AS s USING (station_id)
    WHERE s.capital_city = 'Madrid' AND d.day >= current_date - 7
    ORDER BY d.day;
  • Your daily sales against the capital's rain, by country
    SELECT s.day, s.country_code, s.revenue, w.precipitation_mm, w.tmax_c
    FROM my.sales_daily AS s
    JOIN commons_pubdata.weather.stations AS st ON st.country_code = s.country_code
    JOIN commons_pubdata.weather.daily AS w ON w.station_id = st.station_id AND w.day = s.day;

Know your columns.

ColumnTypeMeaning
station_idstringGHCN station id (joins weather.stations)
daydatethe local calendar day of the observation
tmax_cdoublemaximum temperature, °C
tmin_cdoubleminimum temperature, °C
tavg_cdoubleaverage temperature, °C (not every station reports it)
precipitation_mmdoubleprecipitation, mm
View all 8 columns
snowfall_mmdoublesnowfall, mm
snow_depth_mmdoublesnow depth, mm

Join keys: station_id, day.

Companion tables

  • commons_pubdata.weather.stations: one row per station: name, coordinates, elevation, the capital and country it stands for, the distance

Before you query.

  1. Join through weather.stations to get from a country or capital to a station_id; one station per country.
  2. Nulls are normal (a station may not report TAVG, or a day may be late).
  3. The most recent 3-7 days are often incomplete.
  4. Units are metric; temperatures in °C, precipitation in mm.

Source & licence.

Source
GHCN-Daily (NOAA National Centers for Environmental Information)
Licence
Public domain (US government work); attribution requested
Attribution
Menne, M.J., I. Durre, R.S. Vose, B.E. Gleason, and T.G. Houston, 2012: An overview of the Global Historical Climatology Network-Daily Database. NOAA NCEI.
Coverage
one station per capital where GHCN has one within 60 km reporting since 2015 (62 capitals at the first load); 2015-01-01 to a few days ago
Refresh
weekly, the whole table replaced; source version ghcn-daily 2026-10-10
Table
commons/pubdata · weather.daily · Iceberg v2 · browse the catalog
Recipe
pubdata/recipes/weather_daily.py, registry entry pubdata/registry/weather_daily.yaml

Source: GHCN-Daily (NOAA National Centers for Environmental Information) · Public domain · Snapshot shown: 10 Oct 2026HTML for people. Markdown for agents.