The avwx package

[Tags:library, mit, program, test]

Parse aviation weather reports, currently METARs and TAFs


[Skip to Readme]

Properties

Versions 0.1.0.0, 0.1.0.1, 0.2.0.0, 0.3.0.0, 0.3.0.1, 0.3.0.2
Change log changelog.md
Dependencies attoparsec (>=0.13 && <1), avwx, base (>=4.7 && <5), HTTP (>=4000 && <5000), lens (>=4.1 && <5), optparse-applicative, parsers (>=0.12 && <1), pretty-show, text (>=1.2.2.1 && <1.3) [details]
License MIT
Copyright 2016, Hans-Christian Esperer
Author Hans-Christian Esperer <hc@hcesperer.org>
Maintainer Hans-Christian Esperer <hc@hcesperer.org>
Stability Unknown
Category Aviation
Home page https://www.hcesperer.org/posts/2016-09-20-avwx.html
Source repository head: git clone https://github.com/hce/avwx.git
Uploaded Sat Oct 1 11:03:26 UTC 2016 by hc
Distributions NixOS:0.3.0.2, Stackage:0.3.0.2, Tumbleweed:0.3.0.2
Downloads 198 total (16 in the last 30 days)
Votes
0 []
Status Docs available [build log]
Last success reported on 2016-10-01 [all 1 reports]

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Readme for avwx

Readme for avwx-0.3.0.2

Build Status

avwx

Fetch and parse aviation weather reports.

METARs and TAFs are quite well parseable; however, they were designed primarily to be easily read by humans, not machines. Subtle differences between countries (and even between weather stations) and lack of comprehensive documentation make it very difficult to create a reliable parser. This is subject to ongoing testing. Patches and success reports are most welcome!

Important: "For educational purposes only, not for flight planning! Use at your own risk."

Example session

 ~> metar --metar edny
Parsing "METAR EDNY 220820Z 02005KT 5000 BR SCT008 OVC010 10/09 Q1022"
METAR
  { _metardate = Date { _dayOfMonth = 22 , _hour = 8 , _minute = 20 }
  , _station = ICAO "EDNY"
  , _flags = []
  , _metarwind =
      Just
        Wind
          { _winddirection = Just (Degrees 20)
          , _velocity = Just (Knots 5)
          , _gusts = Nothing
          }
  , _metarvisibility = [ SpecificVisibility (Metres 5000) Nothing ]
  , _runwayvis = []
  , _runwaycond = []
  , _wx =
      [ Phenomenon
          { _intensity = Moderate
          , _desc = Nothing
          , _prec = Nothing
          , _obfus = Just Mist
          , _other = Nothing
          }
      ]
  , _clouds =
      [ ObservedCloud SCT (Height 800) Unclassified
      , ObservedCloud OVC (Height 1000) Unclassified
      ]
  , _metarpressure = Just (QNH 1022)
  , _temperature = Just 10
  , _dewPoint = Just 9
  , _weathertrend = NOTAVAIL
  , _remark = Nothing
  , _maintenance = False
  }

~> metar --taf edny
Parsing "TAF        AMD EDNY 220900Z 2209/2306 24005KT 6000 BKN010        BECMG 2209/2211 SCT020"
Right
  TAF
    { _tafissuedat =
        Date { _dayOfMonth = 22 , _hour = 9 , _minute = 0 }
    , _flags = [ AMD ]
    , _station = ICAO "EDNY"
    , _tafvalidfrom =
        Date { _dayOfMonth = 22 , _hour = 9 , _minute = 0 }
    , _tafvaliduntil =
        Date { _dayOfMonth = 23 , _hour = 6 , _minute = 0 }
    , _tafinitialconditions =
        [ TransWind
            Wind
              { _winddirection = Just (Degrees 240)
              , _velocity = Just (Knots 5)
              , _gusts = Nothing
              }
        , TransVis [ SpecificVisibility (KM 6) Nothing ]
        , TransRunwayVis []
        , TransWX []
        , TransClouds [ ObservedCloud BKN (Height 1000) Unclassified ]
        , TransPressure []
        ]
    , _tafchanges =
        [ BECMG
            (Just Date { _dayOfMonth = 22 , _hour = 9 , _minute = 0 })
            (Just Date { _dayOfMonth = 22 , _hour = 11 , _minute = 0 })
            [ TransClouds [ ObservedCloud SCT (Height 2000) Unclassified ] ]
        ]
    }