Skip to main content

Lightweight Python library for official weather warnings

Project description

wevva-warnings

wevva-warnings is a small Python library and CLI for looking up official weather warnings for a single point.

You provide lat, lon, and a country_code; the library picks the right official source or sources, normalizes the returned alerts, and filters them by native point query or geometry.

Install

pip install wevva-warnings

Quick start

from wevva_warnings import get_alerts_for_point

alerts = get_alerts_for_point(
    lat=40.71,
    lon=-74.00,
    country_code="US",
    active_only=True,
)

for alert in alerts:
    print(alert.headline)
    print(alert.url)

Language-specific feeds can be selected with lang:

alerts = get_alerts_for_point(49.8, 7.67, "DE", lang="de")
wevva-warnings point 40.71 -74.00 US

Public API

from wevva_warnings import get_alerts_for_point, get_alerts_for_source, list_sources

The main entry point is:

  • get_alerts_for_point(lat, lon, country_code, lang=None, debug=False, active_only=False)

Useful lower-level helpers:

  • get_alerts_for_source(source_id, active_only=False)
  • list_sources()

Notes:

  • the caller supplies the correct country_code; the library does not infer country from coordinates
  • if a country has multiple language-specific feeds, English-capable sources are preferred by default
  • if you request an unsupported language, the library warns and falls back to the default source selection
  • get_alerts_for_point(...) raises UnsupportedCountryError when no sources are registered for the supplied country

CLI

Main commands:

  • wevva-warnings point LAT LON COUNTRY_CODE
  • wevva-warnings source SOURCE_ID
  • wevva-warnings sources

Useful flags:

  • --lang de
  • --active
  • --debug
  • --formatted for table output on source

Source registry

There are currently 151 enabled sources in the built-in registry. For the full current list, use:

wevva-warnings sources

The source definitions themselves live in wevva_warnings/sources.py.

Geocode Data

Some EU point matching now uses packaged geocode boundary artifacts derived from Meteoalarm source data.

  • scripts/build_emma_geocodes.py builds a packaged EMMA geometry dataset
  • scripts/build_emma_aliases.py builds a packaged EMMA alias dataset
  • scripts/build_bom_amoc_geocodes.py builds a packaged Australian BoM AMOC geometry dataset

Currently available at runtime:

  • Meteoalarm EMMA_ID geometry resolution
  • Meteoalarm alias resolution to EMMA geometry, including NUTS2, NUTS3, WARNCELL, WARNCELLID, FIPS and CISORP
  • Australian BoM AMOC-AreaCode geometry resolution for polygonal MW, RC, ME and PW code families

The runtime package is intended to ship only the small derived artifacts under wevva_warnings/data/. Large upstream source files are treated as build inputs, not packaged assets.

Note that the EMMA geocode-polygon mapping is retrieved directly, but the aliases file is a Google Drive link which requires manual download. Both files are derived from the Meteoalarm Redistribution Hub.

The current Australian BoM path is narrower and uses official static BoM spatial shapefiles behind AMOC-AreaCode, with the first cut focused on polygonal MW, RC, ME and PW code families.

Intended pattern:

  • keep raw provider geocodes on Alert
  • normalize to one canonical geometry key if aliases are used
  • ship only small derived boundary artifacts
  • avoid runtime dependence on authenticated or mutable upstream APIs

Source Gap Tracker

The sources.csv file is a local snapshot of the WMO source list. Compared with the current registry, the remaining gaps fall into four useful categories.

Empty feeds

Some provider backends have not been fully validated against live alerts because the feed was empty when checked. These should be revisited later:

Source ID Provider Checked Note
nms_belize Belize National Meteorological Service 2026-04-17 RSS feed was empty
meteo_cameroon_en Cameroon National Meteorology 2026-04-17 English feed was empty; French feed was live
vedur Icelandic Meteorological Office 2026-04-17 RSS feed was empty
qatar_caa_en Qatar Civil Aviation Authority 2026-04-17 RSS feed was empty
qatar_caa_ar Qatar Civil Aviation Authority 2026-04-17 RSS feed was empty
imd_india India Meteorological Department 2026-04-17 RSS feed was empty
inam_mz INAM Mozambique 2026-04-17 RSS feed was empty
eswatini_met Eswatini Meteorological Service 2026-04-17 RSS feed was empty
msj Meteorological Service of Jamaica 2026-04-17 Atom feed had no active advisories
dma_anguilla Disaster Management Anguilla 2026-04-17 Atom feed was empty
antigua_met Antigua and Barbuda Meteorological Service 2026-04-17 Atom feed was empty
dem_barbados Department of Emergency Management Barbados 2026-04-17 Atom feed was empty
dmh_myanmar Department of Meteorology and Hydrology Myanmar 2026-04-17 Atom feed was empty
meteo_cw_en Meteorological Department Curaçao 2026-04-17 English feed was empty
meteoalarm_atom_andorra Meteoalarm 2026-04-17 Atom feed was empty
pagasa PAGASA 2026-04-17 Atom feed was empty
ametvigilance_dz AmetVigilance Algeria 2026-04-17 Candidate feed URL returned the web app shell, not a usable RSS or CAP feed
kuwait_met Kuwait Meteorology 2026-04-17 Host did not resolve from this environment
saudi_ncm_en Saudi NCM (English) 2026-04-17 Feed request hung or returned 503 while checking
saudi_ncm_ar Saudi NCM (Arabic) 2026-04-17 Feed request hung while checking
svg_met Saint Vincent and the Grenadines Meteorological Services 2026-04-17 Atom feed was empty
tmd_en Thai Meteorological Department 2026-04-17 RSS feed was empty
tmd_th Thai Meteorological Department 2026-04-17 RSS feed was empty

Intentionally skipped language variants

These are additional language feeds or mirror variants for countries already in the registry. We skipped them deliberately rather than because they were missed.

Country / provider Missing variant Current support Note
Cameroon cm-meteo-ha meteo_cameroon_en, meteo_cameroon_fr Hausa mirror feed not enabled
Curaçao and Sint Maarten cw-meteo-es meteo_cw_en, meteo_cw_nl, meteo_cw_pap Spanish WMO mirror not enabled
India NDMA sachet RSS imd_india Separate provider family from IMD
Mongolia mn-namem-mn namem_en Mongolian feed not enabled
Nigeria ng-nimet-ha nimet_en Hausa feed not enabled

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

wevva_warnings-0.3.0.tar.gz (5.3 MB view details)

Uploaded Source

Built Distribution

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

wevva_warnings-0.3.0-py3-none-any.whl (5.4 MB view details)

Uploaded Python 3

File details

Details for the file wevva_warnings-0.3.0.tar.gz.

File metadata

  • Download URL: wevva_warnings-0.3.0.tar.gz
  • Upload date:
  • Size: 5.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for wevva_warnings-0.3.0.tar.gz
Algorithm Hash digest
SHA256 a7d9b986f8a1d3cac481f9d79a7b39b84257dfb9bebbfd3220a98e63828cbebc
MD5 6afeb1b6dda019a1904412098e1af6c7
BLAKE2b-256 d79149628b3d4802899c93e4dbd4a4a3c511bec47f83777a4f38ccbe2fdd7385

See more details on using hashes here.

File details

Details for the file wevva_warnings-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: wevva_warnings-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 5.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for wevva_warnings-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 87a7f89f3085f95cac2482fbce35d9f97f524820a567cfd327d73df620bda84b
MD5 ba2dc455ff8e59f4c0c13303380516b8
BLAKE2b-256 af82d4e801c80eae6e4f66376622c0917cd71473301a4bcc8b725082cc971c42

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