Skip to main content

CLI to download a 10-years weather data from ERA5 and process it in reports

Project description

sharve-era5-request

CLI for downloading ERA5 single-level data and generating reports.

Install

pip install .

Or for local dev:

pip install -e .

Register for the ERA5 to get an API token

  1. If you do not have an account yet, please register https://cds.climate.copernicus.eu/
  2. If you are not logged in, please login
  3. Open your profile and copy API key

Configure (one time only)

weather configure --token paste_your_api_key_token

Additional config (if needed)

# Configure token (CDS or ADS)
weather configure --token <UID:APIKEY> [--url https://ads.atmosphere.copernicus.eu/api]

Usage

Workflow overview:

  • weather download: fetch 2016-2025 ERA5-Land point time-series (fixed variable set) for one location, with optional automatic geocoding.
  • weather save: write the processed time-series for a location (from cache) to CSV.
  • weather report: generate an HTML report for one location or an aggregated report across multiple locations.
  • weather list: list cached locations (names/country/coords from the database).
  • weather refresh-database: rebuild the SQLite cache from all downloaded datasets.

Commands

Download fixed variables for a point (2016-2025)

weather download --name Gothenburg --lat 57.7 --lon 11.9

Notes: downloads ERA5-Land time-series for the fixed variables into .weather_era5/gothenburg.zip (zip archive containing CSV files). If the file exists, download is skipped.

Download with automatic geocoding

weather download --name Gothenburg --find-city Gothenburg --find-country Sweden

This uses Nominatim to resolve latitude/longitude and country code; you can also provide --find-city alone and let reverse geocoding pick the country.

Save point data to CSV

weather save --name Gothenburg --output ./gothenburg.csv

This reads the downloaded point dataset for the location and writes a CSV with all variables aligned on time.

Generate a report

weather report --name Gothenburg

Produces an HTML report with one summary table for all variables and per-variable histogram and climatology line plots.

Generate an aggregated report across cities (weighted)

weather report --name "Gothenburg,Oslo" --weights "2,1"

Loads each city from the cache, aggregates metrics with provided weights (defaults to equal weights), and writes a combined HTML report.

List cached locations

weather list

Shows name (from the database, falling back to filename if missing), country, and coordinates for cached datasets.

Refresh the cache database

weather refresh-database

Reprocesses all downloaded ZIP/CSV files into the SQLite cache (useful after schema changes or manual file edits).

Options (common)

  • --name: label used for the dataset filename (<name>.zip) and cache key
  • --lat, --lon: latitude/longitude for downloads
  • --output: optional output path for save; defaults to .weather_era5/<name>.csv

Notes

  • Datasets are stored in .weather_era5/ under your home directory by default; a SQLite cache (weather.sqlite) powers report, save, and list.
  • Downloads are global (1h cadence) and can take several minutes per variable/year.
  • save and report read only from the cache; run download (or refresh-database if you already have ZIP/CSV files) first.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

weather_cli_era5-2026.1.19b0.tar.gz (24.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

weather_cli_era5-2026.1.19b0-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

Details for the file weather_cli_era5-2026.1.19b0.tar.gz.

File metadata

  • Download URL: weather_cli_era5-2026.1.19b0.tar.gz
  • Upload date:
  • Size: 24.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for weather_cli_era5-2026.1.19b0.tar.gz
Algorithm Hash digest
SHA256 c496a029fd217b2b62b5ee4a42d2d631eadb6d3223d7d7fe76aee04b14c4a4e0
MD5 92c0be6914bca73089f422102168cc0d
BLAKE2b-256 d0dd33dc726a462de8d49ef30cdaee4b88741463935242b26ed437668a565cd3

See more details on using hashes here.

File details

Details for the file weather_cli_era5-2026.1.19b0-py3-none-any.whl.

File metadata

File hashes

Hashes for weather_cli_era5-2026.1.19b0-py3-none-any.whl
Algorithm Hash digest
SHA256 6f3ab4bbed2bd9ec25521862e68c6117a9eda76ff1fd756c3156f4349fd3babf
MD5 274504e9a0d675d4013ce5db6810d454
BLAKE2b-256 6058b2990a6c5285699c1114e640ee9c4537db86a18040c5194d68ba6fe319c5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page