Metar - Python METAR report parser

2.0.1 · active · verified Fri Apr 17

Metar is a Python package designed to parse METAR-coded weather reports, providing easy access to various meteorological data points such as wind, temperature, visibility, and cloud conditions. The project recently settled on the package name `metar` (previously `python-metar`). It is currently at version 2.0.1, with an active release cadence, and requires Python >=3.10.

Common errors

Warnings

Install

Imports

Quickstart

Parse a sample METAR string and access its attributes, then print a human-readable summary.

from metar.Metar import Metar

# Example METAR string
metar_string = "METAR KSLK 200853Z AUTO 09006KT 10SM CLR 02/M01 A2999 RMK AO2"

# Parse the METAR report
m = Metar(metar_string)

# Access parsed data
print(f"Station: {m.station_id}")
print(f"Time: {m.time}")
print(f"Wind: {m.wind_dir}{m.wind_speed}KT")
print(f"Temperature: {m.temp}°C")
print(f"Dew Point: {m.dewpt}°C")
print(f"Visibility: {m.vis.value}{m.vis.units}")

# Print a formatted report
print("\n--- Formatted Report ---")
print(m.string())

view raw JSON →