get_inventory()

Get the data inventory for all stations and years.

Usage

Source

get_inventory(
    *,
    force_refresh=False,
)

Downloads and parses the ISD inventory file containing record counts for each station by year and month.

Parameters

force_refresh: bool = False
Force re-download of inventory data even if cached. Default is False.

Returns

pl.DataFrame
A DataFrame with inventory information.

Columns

The returned DataFrame contains the following columns:

  • id: Station ID (USAF-WBAN format)
  • usaf: USAF station identifier
  • wban: WBAN station identifier
  • year: Year of data
  • jan through dec: Record counts for each month
  • total: Total records for the year

Examples

Get data inventory for all stations:

import weathervault as wv
import polars as pl

inventory = wv.get_inventory()
inventory.filter(pl.col("id") == "725030-14732")
shape: (53, 17)
idusafwbanyearjanfebmaraprmayjunjulaugsepoctnovdectotal
strstrstri64i64i64i64i64i64i64i64i64i64i64i64i64i64
"725030-14732""725030""14732"19737666808487487887797737477157527257989119
"725030-14732""725030""14732"19747937197987327927497567897507607657579160
"725030-14732""725030""14732"19758127367867257627837847587527887588119255
"725030-14732""725030""14732"19768167248007477967788238137688097477869407
"725030-14732""725030""14732"19777947438227847777807808058088048508079554
……………………………………………
"725030-14732""725030""14732"202111231083114910861126108312391170111411791031118213565
"725030-14732""725030""14732"202211791099119510921269112210901090107911631103117213653
"725030-14732""725030""14732"202312071049118011441071111711481194116111351027121413647
"725030-14732""725030""14732"202412361053114511451186106311251160108810571013114313414
"725030-14732""725030""14732"2025109210501157109912621128112490100008813