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 152 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
  • scripts/build_jma_area_geocodes.py builds a packaged JMA area-code 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
  • JMA JMA Area Code geometry resolution from official JMA GIS boundary datasets

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. Geocode geometries now default to packaged per-code artifacts for lazy loading at runtime, while EMMA aliases are shipped as a small plain JSON mapping.

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.1.tar.gz (11.0 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.1-py3-none-any.whl (12.1 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: wevva_warnings-0.3.1.tar.gz
  • Upload date:
  • Size: 11.0 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.1.tar.gz
Algorithm Hash digest
SHA256 5aab1fceca2f81a54c171237cbf0edc33ba0b67692b59040960f29dab42f44d3
MD5 a89439cf266d6d138e064781a40cdac2
BLAKE2b-256 e66efb5dabbc14f9fac6d9726b1367a5c8f4561dc0426b8dd5cadf45e3142ff4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wevva_warnings-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 12.1 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d9169b3cfd10058211429c4a9cde0d4c1ef639c0457eb638d7d379abdbea1dea
MD5 326372465cb47b17a255b6c5736146bf
BLAKE2b-256 6b58680a67ab34546b615d5df054269a7c62844abcbcdffb78ea660b16bdf43b

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