Metar - a package to parse METAR-coded weather reports
Maintained. Last release 5 weeks ago, commits in 7 of the last 26 weeks. Weaker on release cadence and security practices.
pip install metarREADME as published on PyPI with version 2.0.2.
Python-Metar
Python-metar is a python package for interpreting METAR and SPECI coded weather reports.
METAR and SPECI are coded aviation weather reports. The official coding schemes are specified in the World Meteorological Organization (WMO) Manual on Codes, vol I.1, Part A (WMO-306 I.i.A). US conventions for METAR/SPECI reports vary in a number of ways from the international standard, and are described in chapter 12 of the Federal Meteorological Handbook No.1. (FMH-1 1995), issued by the National Oceanic and Atmospheric Administration (NOAA). General information about the use and history of the METAR standard can be found here.
This module extracts the data recorded in the main-body groups of reports that follow the WMO spec or the US conventions, except for the runway state and trend groups, which are parsed but ignored. The most useful remark groups defined in the US spec are parsed, as well, such as the cumulative precipitation, min/max temperature, peak wind and sea-level pressure groups. No other regional conventions are formally supported, but a large number of variant formats found in international reports are accepted.
Current METAR reports
Current and historical METAR data can be obtained from various places. The current METAR report for a given airport is available at the URL
https://tgftp.nws.noaa.gov/data/observations/metar/stations/<station>.TXT
where station is the four-letter ICAO airport station code. The
accompanying script get_report.py will download and decode the
current report for any specified station.
The METAR reports for all stations (worldwide) for any "cycle" (i.e., hour) in the last 24 hours are available in a single file at the URL