A Flask web application that turns cryptic aviation weather reports (METARs) into plain-English descriptions anyone can understand.
Type in any ICAO airport code and get a friendly summary like:
Mostly cloudy. Temperature 13°C (55°F). Wind from the West at 11 knots (13 mph). Excellent visibility.
A METAR is a standardized weather observation used by pilots and air traffic control worldwide. They look like this:
KHIO 022353Z 26011KT 10SM BKN060 13/01 A3021
This app decodes every field — wind direction and speed, visibility, cloud layers, temperature, dewpoint, and altimeter setting — and presents them in a format that requires no aviation knowledge to read.
- Live data fetched directly from aviationweather.gov
- Supports any ICAO airport code worldwide (e.g.
KLAX,EGLL,RJTT) - Converts units to mph and °F alongside native aviation units
- Handles complex visibility formats, gusting winds, multiple cloud layers, and present weather (rain, snow, fog, thunderstorms, etc.)
- Collapsible raw METAR display for the curious
- Clean, mobile-friendly interface
Requirements: Python 3.10 or later
-
Clone the repository
git clone https://github.com/your-username/metar-reader.git cd metar-reader -
Create and activate a virtual environment (recommended)
python3 -m venv venv source venv/bin/activate # macOS / Linux venv\Scripts\activate # Windows
-
Install dependencies
pip install -r requirements.txt
-
Run the application
python app.py
-
Open your browser and go to
http://127.0.0.1:5000
Enter a four-letter ICAO airport code in the search box and press Get Weather.
| Example code | Airport |
|---|---|
KLAX |
Los Angeles International |
KJFK |
John F. Kennedy International (New York) |
KORD |
O'Hare International (Chicago) |
EGLL |
London Heathrow |
RJTT |
Tokyo Haneda |
Tip: ICAO codes are not the same as the shorter IATA codes used on flight tickets (e.g. LAX, JFK). In the US, most codes start with
Kfollowed by the three-letter IATA code.
The test suite uses pytest and covers all parsing logic and Flask routes. No network connection is required — external API calls are mocked.
Run the tests:
pytest test_app.py -vExpected output: 72 tests passing in under a second.
The suite is organised into four test classes:
| Class | Tests | Covers |
|---|---|---|
TestDegreesToCompass |
10 | Cardinal and intercardinal wind direction conversions |
TestParseVisibility |
11 | All visibility formats: statute miles, fractions, meters, CAVOK, "less than" prefix |
TestDecodeMetar |
29 | Every METAR field — wind, gusts, sky layers, weather phenomena, temperatures, altimeter, edge cases |
TestGenerateSummary |
12 | Plain-English summaries for all sky and weather conditions |
TestFlaskRoutes |
8 | HTTP responses, mocked API calls, error handling, form behaviour |
Weather data is retrieved in real time from the Aviation Weather Center API, operated by NOAA. No API key is required.
metar-reader/
├── app.py # Flask application and METAR parser
├── test_app.py # Pytest unit and integration tests
├── requirements.txt # Python dependencies
└── templates/
└── index.html # Front-end template
MIT