From 598163fb27b71ad4f835b491c0998c6cb2cd616d Mon Sep 17 00:00:00 2001 From: _ <_@_> Date: Wed, 15 Jan 2025 01:56:07 +0000 Subject: [PATCH] show example output --- README.md | 157 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 157 insertions(+) diff --git a/README.md b/README.md index 4ae269d..dde6da3 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,160 @@ # weather_dot_gov_rs Parses the DWML machine-readable format produced by forecast.weather.gov. + +e.g. `cargo run --example reqwest 40.71 -74.01` yields: + +``` +Dwml { + head: Head { + product: Product { + creation_date: CreationDate { + refresh_frequency: "PT1H", + value: "2025-01-14T18:08:11-05:00", + }, + }, + source: Source { + production_center: "New York, NY", + }, + }, + data: ( + Forecast { + location: Location { + area_description: None, + description: Some( + "New York, NY", + ), + }, + time_layout: ( + TimeLayout { + time_coordinate: Local, + layout_key: K12Hourly, + start_valid_time: [ + StartValidTime { + period_name: "Tonight", + value: "2025-01-14T20:00:00-05:00", + }, + ... + StartValidTime { + period_name: "Tuesday", + value: "2025-01-21T06:00:00-05:00", + }, + ], + }, + TimeLayout { + time_coordinate: Local, + layout_key: K24Hourly1, + start_valid_time: [ + StartValidTime { + period_name: "Tonight", + value: "2025-01-14T20:00:00-05:00", + }, + ... + StartValidTime { + period_name: "Monday Night", + value: "2025-01-20T18:00:00-05:00", + }, + ], + }, + TimeLayout { + time_coordinate: Local, + layout_key: K24Hourly2, + start_valid_time: [ + StartValidTime { + period_name: "Wednesday", + value: "2025-01-15T06:00:00-05:00", + }, + ... + StartValidTime { + period_name: "Tuesday", + value: "2025-01-21T06:00:00-05:00", + }, + ], + }, + ), + parameters: Parameters { + temperature: ( + Temperature { + temp_type: Minimum, + units: Fahrenheit, + time_layout: K24Hourly1, + value: [ + 26, + 24, + 27, + 34, + 34, + 24, + 17, + ], + }, + Temperature { + temp_type: Maximum, + units: Fahrenheit, + time_layout: K24Hourly2, + value: [ + 33, + 32, + 39, + 43, + 39, + 30, + 24, + ], + }, + ), + probability_of_precipitation: ProbabilityOfPrecipitation { + time_layout: K12Hourly, + value: [ + PrecipitationValue { + value: None, + }, + ... + PrecipitationValue { + value: Some( + 30, + ), + }, + PrecipitationValue { + value: None, + }, + PrecipitationValue { + value: None, + }, + ], + }, + weather: Weather { + time_layout: K12Hourly, + weather_conditions: [ + WeatherCondition { + weather_summary: "Mostly Clear", + }, + ... + WeatherCondition { + weather_summary: "Mostly Sunny", + }, + ], + }, + }, + }, + CurrentObservations { + location: Location { + area_description: Some( + "New York City, Central Park, NY", + ), + description: None, + }, + time_layout: TimeLayout { + time_coordinate: Local, + layout_key: K1Hour, + start_valid_time: [ + StartValidTime { + period_name: "current", + value: "2025-01-14T19:51:00-05:00", + }, + ], + }, + }, + ), +} +```