Skip to content

stoffis-git/world-temperature-data

Repository files navigation

world-temperature-data

Monthly mean air temperature for 270 cities worldwide. Twelve monthly normals plus an annual mean, as a tiny zero-dependency package for both JavaScript and Python, with the raw CSV bundled.

Data by GeoRank.place — see the interactive temperature map. Licensed CC-BY-4.0.

Method

Mean monthly near-surface air temperature (°C) from CHELSA v2.1 climatological normals (1981–2010), warped to a 0.05° grid and sampled per city. annualC is the mean of the 12 months. Full sources in ATTRIBUTION.md.

Install

npm install world-temperature-data      # JavaScript / TypeScript
pip install world-temperature-data      # Python

Usage

JavaScript / TypeScript

import { byCity, byCountry, cities } from "world-temperature-data";

const lisbon = byCity("Lisbon", "PT");
lisbon.annualC;            // e.g. 16.3
lisbon.monthly.jul;        // July mean, °C
lisbon.warmestMonth;       // "aug"
cities().length;           // 270

Python

from world_temperature_data import by_city, by_country, cities

lisbon = by_city("Lisbon", "PT")
lisbon["annual_c"]         # e.g. 16.3
lisbon["monthly"]["jul"]   # July mean, °C
lisbon["warmest_month"]    # "aug"
len(cities())              # 270

Data schema

Field Type Description
city string City name
countryIso2 / country_iso2 string ISO-3166 alpha-2 country code
lat, lon number Coordinates (decimal degrees)
monthly object { jan … dec } mean temperature in °C
annualC / annual_c number Mean annual temperature, °C
warmestMonth / coldestMonth string Extreme months (e.g. "aug", "jan")
source string Methodology label

The raw CSV ships in the package (world_temperature_data/world-temperature.csv).

Pairs well with

sunshine-hours-by-city, world-rainfall-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.

About

Monthly mean air temperature for 270 cities (CC-BY-4.0). 12 monthly normals + annual mean, from CHELSA v2.1. Data by georank.place.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors