weather-reports

Crates.ioweather-reports
lib.rsweather-reports
version0.1.5
sourcesrc
created_at2021-08-29 04:33:57.182203
updated_at2021-09-04 22:57:00.963525
descriptionA collection of weather report parsers
homepage
repositoryhttps://github.com/sameer/weather-reports
max_upload_size
id443642
size366,030
Sameer Puri (sameer)

documentation

https://docs.rs/weather-reports

README

weather-reports

A collection of weather report parsers

crates.io weather-reportsweather-reports codecov

Supported Formats

Demo

> cargo run --release --example parse -
KSEA 290353Z 01008KT 10SM SCT200 19/09 A3004 RMK AO2 SLP179 T01940094
MetarReport {
    identifier: "KSEA",
    observation_time: ZuluDateTime {
        day_of_month: 29,
        time: ZuluTime {
            hour: 3,
            minute: 53,
        },
        is_zulu: true,
    },
    observation_validity_range: None,
    observation_type: None,
    wind: Some(
        Wind {
            direction: Some(
                0.17453292519943295,
            ),
            speed: 4.115555555555556 m^1 s^-1,
            peak_gust: None,
            variance: None,
        },
    ),
    visibility: Some(
        Visibility {
            prevailing: 16093.44 m^1,
            minimum_directional: None,
            maximum_directional: None,
        },
    ),
    runway_visibilities: [],
    runway_reports: [],
    weather: [],
    cloud_cover: [
        CloudCover {
            coverage: Scattered,
            base: Some(
                6096.0 m^1,
            ),
            cloud_type: None,
        },
    ],
    cavok: false,
    temperatures: Some(
        Temperatures {
            air: 292.15 K^1,
            dewpoint: Some(
                282.15 K^1,
            ),
        },
    ),
    pressure: Some(
        300400.0 m^-1 kg^1 s^-2,
    ),
    accumulated_rainfall: None,
    color: None,
    recent_weather: [],
    water_conditions: None,
    trends: [],
    remark: Some(
        "RMK AO2 SLP179 T01940094\n",
    ),
    maintenance_needed: false,
}
Success!

Debugging

Each example generates a parser trace when the trace feature is enabled. To generate and visualize one with pegviz:

cargo run --release --features trace --example metar - | pegviz --output index.html && firefox index.html

References

Commit count: 26

cargo fmt