---
name: weathervault
description: >
  Obtain Polars DataFrames of historical weather data from the NCEI weather database. Use when writing Python code that uses the weathervault package.
license: MIT
compatibility: Requires Python >=3.10.
---

# weathervault

Obtain Polars DataFrames of historical weather data from the NCEI weather database

## Installation

```bash
pip install weathervault
```

## API overview

### Core Functions

Primary functions for retrieving weather data and station information.

- `get_weather_data`: Get weather data for a meteorological station
- `get_station_metadata`: Get metadata for all weather stations
- `search_stations`: Search for weather stations matching specified criteria

### Station Discovery

Functions for exploring available stations and their data coverage.

- `get_inventory`: Get the data inventory for all stations and years
- `get_years_for_station`: Get the list of years for which a station has data
- `get_countries`: Get a DataFrame of country codes and names

### Helper Objects

Convenience objects for station and location lookups with autocomplete support.

- `station`: Helper object for accessing weather station IDs with autocomplete
- `country`: Helper object for accessing ISO 3166-1 alpha-2 country codes with autocomplete
- `state`: Helper object for accessing US state and territory codes with autocomplete

### Constants

Data constants and URL configurations used by the package.

- `BASE_URL`: str(object='') -> str
- `COUNTRY_CODES`: dict() -> new empty dictionary
- `ISO_COUNTRY_NAMES`: dict() -> new empty dictionary
- `US_STATE_NAMES`: dict() -> new empty dictionary

## Resources

- [llms.txt](llms.txt) — Indexed API reference for LLMs
- [llms-full.txt](llms-full.txt) — Comprehensive documentation for LLMs
- [Source code](https://github.com/rich-iannone/weathervault)
