⚠️ Status: Active development – current version0.2.0-alpha5Note: METAR parsing advanced groups (CAVOK, RVR, MPS, Temperature +/-). RMK will be added in a future alpha.
A modern, strongly-typed METAR and TAF parser written in Rust.
metar_taf_parser provides a reusable parsing library and a command-line interface
to parse aviation weather reports (METAR and TAF) into structured data,
with full support for advanced weather phenomena.
- Station identifier
- Observation time (
ddhhmmZ) - Wind:
- direction, speed, gusts
- variable wind
- Visibility:
- prevailing visibility
- minimum visibility with direction (e.g.
2000SW)
- Cloud layers:
- FEW, SCT, BKN, OVC
- cloud height
- cloud types (CB, TCU)
- Temperature and dew point
- Pressure (QNH)
- Advanced weather phenomena:
- intensity (
-,+) - descriptors (
TS,SH,FZ,VC, …) - phenomena (
RA,SN,BR,FG, …) - multiple simultaneous weather groups
- intensity (
- Full TAF header parsing (station, issue time, validity)
- Forecast groups:
- Base forecast
FMBECMGTEMPOPROB30/PROB40(with or withoutTEMPO)
- Reuse of METAR parsing logic for:
- wind
- visibility
- clouds
- weather
- Explicit forecast period modeling
The project is structured as a Rust workspace:
metar_taf_parser/
├── crates/
│ ├── metar-taf-core/ # Parsing library
│ └── metar-taf-cli/ # Command-line interface
├── Cargo.toml
├── README.md
└── CHANGELOG.md
- Token-based parsing
- Strongly typed domain models
- Designed to be embedded in other applications
- No I/O, no CLI assumptions
- Simple interface for parsing METAR / TAF strings
- Intended mainly for inspection and testing
- Will evolve in future releases
- ✔ Wind (KT / MPS, gusts)
- ✔ Visibility (including CAVOK)
- ✔ RVR (basic ICAO format)
- ✔ Clouds
- ✔ Weather phenomena
- ✔ Temperature / Dew point (including negative values)
- ✔ Pressure (QNH)
- ✔ RMK (raw, unparsed)
⚠ Runway state groups are not parsed yet.
git clone https://github.com/<your-org-or-user>/metar_taf_parser.git
cd metar_taf_parser
cargo build --releasemetar-taf <ICAO> get --metar
metar-taf <ICAO> get --taf
metar-taf <ICAO> get --allIf the ICAO code is not provided, the CLI will prompt interactively:
metar-taf get --metar
Enter ICAO airport code:The CLI fetches the latest available data from the NOAA Aviation Weather service and automatically parses the returned METAR or TAF.
By default, the CLI outputs the parsed data in debug format:
# Parsed output (default)
metar-taf LIRF get --metar
# Raw METAR / TAF only
metar-taf LIRF get --metar --raw
# JSON output
metar-taf LIRF get --metar --jsonNotes:
--rawoutputs only the raw report string--jsonoutputs only JSON--rawand--jsoncannot be used together
Add the core crate to your Cargo.toml:
[dependencies]
metar-taf-core = "0.1.0"Example:
use metar_taf_core::parse_metar;
let metar = parse_metar(
"LIRF 121250Z 18012KT 9999 FEW030 SCT080 18/12 Q1015"
) ?;
println!("{:#?}", metar);- Unit tests for individual parsers
- Golden tests using real-world METAR and TAF reports
cargo clippyclean with-D warnings
This project follows Semantic Versioning.
0.1.0is the initial stable release- Public API is considered experimental and may evolve in future minor versions
See CHANGELOG.md for details.
Planned for upcoming 0.2.x releases:
- ICAO validation and airport metadata lookup
- Golden JSON snapshot tests
- Human-readable pretty output
- Extended TAF support (INTER, CNL, AMD)
MIT License.
Developed and maintained by Alessandro Maestri.