Skip to content

meteostat/cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

PyPI Version Issues MIT License


Meteostat Logo

Meteostat CLI

Access weather and climate data through the terminal.

Explore the docs Β»

Visit Website Β· Report Bug Β· Request Feature

πŸ“š Installation

uv tool install meteostat-cli

For plotting capabilities (png and svg output), install the plot extra:

uv tool install "meteostat-cli[plot]"

Alternatively, you can use uvx:

uvx --from meteostat-cli meteo

πŸš€ Usage

Get daily weather data for a station

meteo daily 10637 --start 2024-01-01 --end 2024-12-31

Get hourly data by coordinates (with interpolation)

meteo hourly 50.1109,8.6821 --start 2024-01-01 --end 2024-01-07

Export data to a file

meteo daily 10637 -s 2024-01-01 -e 2024-12-31 --output data.json

Plot temperature data

meteo daily 10637 -s 2024-01-01 -e 2024-12-31 --output chart.png

πŸ“– Commands

meteo station β€” Browse weather stations

meteo station 10637                        # Metadata for a specific station
meteo station --country DE                 # List stations by country
meteo station --country DE --state HE      # Filter by country and state
meteo station --name "Frankfurt"           # Search by name
Option Short Description
--country -c ISO 3166-1 alpha-2 country code
--state State or region code
--name -n Station name (partial match)
--wmo -w WMO station ID
--icao -i ICAO station ID
--iata IATA station ID
--national -N National station ID
--bbox Bounding box (lon_min,lat_min,lon_max,lat_max)
--sql Arbitrary SQL query
--format -f Output format: csv, json, xlsx, parquet
--output -o Output file path (defaults to stdout)
--no-header Omit CSV header row
--all -A Print full table without truncation

meteo nearby β€” Find stations near a location

meteo nearby 50.1109 8.6821                        # Nearest stations (default: 5 within 5 km)
meteo nearby 50.1109 8.6821 --limit 10             # Return up to 10 stations
meteo nearby 50.1109 8.6821 --radius 20000         # Search within 20 km
meteo nearby 50.1109 8.6821 --format json          # JSON output
Option Short Description
--limit -l Maximum number of stations (default: 5)
--radius -r Search radius in meters (default: 5000)
--format -f Output format: csv, json, xlsx, parquet
--output -o Output file path (defaults to stdout)
--no-header Omit CSV header row
--all -A Print full table without truncation

meteo inventory β€” Check data availability

meteo inventory 10637
meteo inventory 10637 --granularity daily --parameters tavg,tmin,tmax
Option Short Description
--granularity -g Filter by granularity: hourly/h, daily/d, monthly/m
--parameters -p Comma-separated parameters (e.g. tavg,tmin,tmax)
--providers -P Comma-separated data providers
--format -f Output format: csv, json, xlsx, parquet
--output -o Output file path (defaults to stdout)
--no-header Omit CSV header row
--all -A Print full table without truncation

meteo hourly β€” Hourly weather data

meteo hourly 10637 --start 2024-01-01 --end 2024-01-31
meteo h 10637 -s 2024-01-01 -e 2024-01-31                    # Short form
meteo hourly 10637 10635 -s 2024-01-01 -e 2024-01-31         # Multiple stations
meteo hourly 10637 --agg max -s 2024-01-01 -e 2024-01-31     # Aggregate by station and time

See Common options below. Hourly also supports --timezone/-t (e.g. Europe/Berlin).

meteo daily β€” Daily weather data

meteo daily 10637 --start 2024-01-01 --end 2024-12-31
meteo d 10637 -s 2024-01-01 -e 2024-12-31    # Short form

See Common options below.

meteo monthly β€” Monthly weather data

meteo monthly 10637 --start 2020 --end 2024
meteo m 10637 -s 2020 -e 2024               # Short form

See Common options below.

meteo normals β€” Climate normals

meteo normals 10637 --start 1991 --end 2020
meteo n 10637 -s 1991 -e 2020               # Short form

See Common options below.

Common options (hourly / daily / monthly / normals)

Option Short Description
--start -s Start date (YYYY-MM-DD, YYYY-MM, YYYY)
--end -e End date (same formats)
--parameters -p Comma-separated parameters (e.g. tavg,tmin,tmax,prcp)
--providers -P Comma-separated data providers
--format -f Output format: csv, json, xlsx, parquet, png, svg
--output -o Output file path (defaults to stdout)
--timezone -t Timezone for timestamps (e.g. Europe/Berlin) β€” hourly only
--with-sources -S Include data source column in output
--no-models Exclude model data (e.g. MOSMIX)
--no-header Omit CSV header row
--no-cache Disable result caching
--all -A Print full table without truncation
--agg Aggregation function: mean, sum, min, max

meteo config β€” Manage configuration

meteo config --list                        # List all settings
meteo config cache_enable false            # Set a value
meteo config interpolation_radius 25000

Configuration is stored in cli.yml under typer.get_app_dir("meteostat").

Shell completion

meteo --install-completion   # Bash, Zsh, Fish, PowerShell

🀝 Contributing

Please read our contributing guidelines for details on how to contribute to Meteostat.

πŸ“„ License

The Meteostat CLI is licensed under the MIT License. Data provided by Meteostat is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0). See the documentation for details.

About

Access weather and climate data through the terminal.

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages