world-rainfall-data
v0.1.0
Published
Mean annual precipitation for 270 cities worldwide (CC-BY-4.0). Derived from CHELSA v2.1 (1981-2010), bias-corrected against GHCN-M stations.
Maintainers
Readme
world-rainfall-data
Mean annual precipitation for 270 cities worldwide. A tiny zero-dependency package for both JavaScript and Python, with the raw CSV bundled.
Data by GeoRank.place — see the interactive rainfall map. Licensed CC-BY-4.0.
Method
Annual precipitation (mm) from CHELSA v2.1 climatological normals (1981–2010), bias-corrected against ~25,000 GHCN-M v4 stations, sampled per city. Full sources in ATTRIBUTION.md.
Install
npm install world-rainfall-data # JavaScript / TypeScript
pip install world-rainfall-data # PythonUsage
JavaScript / TypeScript
import { byCity, byCountry, cities } from "world-rainfall-data";
byCity("Lisbon", "PT"); // { city: "Lisbon", countryIso2: "PT", annualMm: 665, ... }
byCountry("ES"); // every Spanish city
cities().length; // 270Python
from world_rainfall_data import by_city, by_country, cities
by_city("Lisbon", "PT") # {"city": "Lisbon", "country_iso2": "PT", "annual_mm": 665, ...}
by_country("ES") # every Spanish city
len(cities()) # 270Data schema
| Field | Type | Description |
|-------|------|-------------|
| city | string | City name |
| countryIso2 / country_iso2 | string | ISO-3166 alpha-2 country code |
| lat, lon | number | Coordinates (decimal degrees) |
| annualMm / annual_mm | number | Mean annual precipitation, mm |
| source | string | Methodology label |
The raw CSV ships in the package (world_rainfall_data/world-rainfall.csv).
Pairs well with
sunshine-hours-by-city,
world-temperature-data, and
georank — rank cities by weighted climate
criteria. See it live at georank.place.
License
Data: CC-BY-4.0 © GeoRank.place. Attribution required — see ATTRIBUTION.md. Package code: MIT.
