February 16, 2007 12:18 CET
METAR.py
A python class that can fetch METAR records
from the NOAA archive
and decode them. ICAO airport codes are classified by geographical area (nation, continent);
this class neither knows the full name nor the precise location of an airport.
For example, the following METAR record:
PASP 081554Z 00000KT 5SM -SN OVC060 M12/M14 A2987 RMK ESTIMATED PASS OPEN NOSPECIYields the following output:
clouds = OVC060 (overcast 1828.8m) temperature = M12/M14 (-12) visibility = 5SM airport = PASP (Alaska, Northern Pacific) weather = -SN (light snow) time = 081554Z wind = 00000KT dewpoint_parsed = -14 METAR = PASP 081554Z 00000KT 5SM -SN OVC060 M12/M14 A2987 RMK ESTIMATED PASS OPEN NOSPECI period = 2007020816
Download:
METAR.tar.gz (4.58KiB gzipped tarball, MD5: 80267d872cf0c4a33ba1b29b01f3fab8)