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

Install with pip

pip install weather-cli-era5

Local installation from the repository

pip install .

Or for local installation in editable mode (for development):

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

  • A download for a specific location takes approximately 30s
  • Datasets are stored in .weather_era5/ under your home directory by default; a SQLite cache (weather.sqlite) powers report, save, and list.
  • 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.20.tar.gz (27.4 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.20-py3-none-any.whl (24.9 kB view details)

Uploaded Python 3

File details

Details for the file weather_cli_era5-2026.1.20.tar.gz.

File metadata

  • Download URL: weather_cli_era5-2026.1.20.tar.gz
  • Upload date:
  • Size: 27.4 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.20.tar.gz
Algorithm Hash digest
SHA256 3cf89e3bda09df4065fd3a2ada61887291bdb486efa77b27ca577208920f0c46
MD5 537939df695277582f1d9af48852e1f7
BLAKE2b-256 915dfbff64cc559fe4ebc7395673dbf267e4ff8dbe1d915a5a483598f8530519

See more details on using hashes here.

File details

Details for the file weather_cli_era5-2026.1.20-py3-none-any.whl.

File metadata

File hashes

Hashes for weather_cli_era5-2026.1.20-py3-none-any.whl
Algorithm Hash digest
SHA256 a2b4c1a68c540d592bf99f4f4ab4f56a09946cf236afc9efd8bf829da5cb1bdd
MD5 33d685b4cf87bc535c0cfac921affe82
BLAKE2b-256 9fdf89d1d2247b292b95f9a3d59dd781be3cf9d754f10c22fdade96ccfc67e28

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