Skip to main content

sunshine-hours-by-city

Calibrated mean annual sunshine hours for 270 cities worldwide. Available as a tiny zero-dependency package for both JavaScript and Python, with the raw CSV bundled.

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

Method

Values blend EUMETSAT CM SAF SARAH-3 satellite radiation (1991–2020) with ECMWF ERA5, bias-corrected against 56 WMO reference stations (actual ≈ 1.14 × ERA5 − 1,550, R² = 0.82, n = 56). Each city is snapped to the nearest cell of the calibrated grid. Full sources and licensing in ATTRIBUTION.md.

Install

npm install sunshine-hours-by-city      # JavaScript / TypeScript
pip install sunshine-hours-by-city      # Python

Usage

JavaScript / TypeScript

import { cities, byCity, byCountry } from "sunshine-hours-by-city";

byCity("Lisbon", "PT");   // { city: "Lisbon", countryIso2: "PT", annualHours: 2799, ... }
byCountry("ES");          // every Spanish city
cities().length;          // 270

Python

from sunshine_hours_by_city import cities, by_city, by_country

by_city("Lisbon", "PT")   # {"city": "Lisbon", "country_iso2": "PT", "annual_hours": 2799, ...}
by_country("ES")          # every Spanish city
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)
annualHours / annual_hours number Calibrated mean annual sunshine hours
calibrated boolean WMO-calibrated flag
source string Methodology label

The raw CSV ships in the package (sunshine_hours_by_city/sunshine-hours.csv).

Pairs well with

georank — rank these cities by weighted criteria (sunshine, cost, climate). See it live at georank.place.

License

Data: CC-BY-4.0 © GeoRank.place. Attribution required — see ATTRIBUTION.md. Package code: MIT.

Metadata

Release files for sunshine-hours-by-city 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sunshine-hours-by-city 0.1.0
File Size Uploaded Provenance
sunshine_hours_by_city-0.1.0.tar.gz 9.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for sunshine-hours-by-city 0.1.0
File Interpreter ABI Platform
sunshine_hours_by_city-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.7 kB

Release files / sunshine_hours_by_city-0.1.0.tar.gz

Download URL sunshine_hours_by_city-0.1.0.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a768b6de074bad83e19ef2e9092ae8ff8ecfce1e86ba1de3b89d09105dcc6ec5
BLAKE2b-256 checksum
How to use checksums
ce80f3875c1b2f9c68a337e7721bf3d0a1d7c3fb7bbc974e700c367698c05a10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / sunshine_hours_by_city-0.1.0-py3-none-any.whl

Download URL sunshine_hours_by_city-0.1.0-py3-none-any.whl
Size 9.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f2e2f46459b0a9bba2fc62380efc4fc782518441465c9b98585609e36abc5a59
BLAKE2b-256 checksum
How to use checksums
3a3bb0ffad6590ae16da5b0a15d5fd246cb3aaf8ae19db9559dc398a79784ac7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Security for sunshine-hours-by-city 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page