Skip to main content

Build Database

Build a SQLite database or a Parquet file from the station files in your local repository. The SQLite database has the same structure as the official stations database, which makes it easy to test your changes locally before submitting them.

Usage​

meteo station build [OPTIONS]

By default, the database is written to stations.db in the root of the stations repository. With --format parquet, the default file is stations.parquet. Existing files are overwritten.

Examples​

meteo station build                         # Build stations.db in the repository root
meteo station build --output ~/stations.db # Custom output path
meteo station build --format parquet # Build stations.parquet in the repository root

Parquet Format​

The Parquet file contains one row per station, sorted by ID:

ColumnTypeDescription
idstringMeteostat ID
namestringEnglish name
namesmap<string, string>Names in other languages by language code (null if none)
countrystringISO 3166-1 alpha-2 country code
regionstringISO 3166-2 region code
latitudedoubleLatitude
longitudedoubleLongitude
elevationint16Elevation in meters
timezonestringIANA time zone
identifiersmap<string, string>Identifiers by key, e.g. wmo or icao (null if none)

Identifiers and translated names are stored as maps, so new identifier types or languages don't change the columns. Parquet readers can load only the columns they need, e.g. with DuckDB:

SELECT id, latitude, longitude, identifiers['icao'] AS icao
FROM 'stations.parquet';

Parquet output requires the contrib extra:

uv tool install "meteostat-cli[contrib]"

Options​

OptionShortDescription
--output-oOutput file path (default: stations.db or stations.parquet in the repository root)
--format-fOutput format: sqlite (default) or parquet
--skip-validationDon't validate stations before building
--repoPath to the stations repository (overrides stations_repo)
info

Stations which fail validation are skipped and reported unless --skip-validation is set.