Cavok 0.1.1

dotnet add package Cavok --version 0.1.1
                    
NuGet\Install-Package Cavok -Version 0.1.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Cavok" Version="0.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Cavok" Version="0.1.1" />
                    
Directory.Packages.props
<PackageReference Include="Cavok" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Cavok --version 0.1.1
                    
#r "nuget: Cavok, 0.1.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Cavok@0.1.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Cavok&version=0.1.1
                    
Install as a Cake Addin
#tool nuget:?package=Cavok&version=0.1.1
                    
Install as a Cake Tool

Cavok

CI NuGet License: MIT

A METAR and TAF parser for .NET that treats the European ICAO format as a first-class citizen.

Metar metar = Metar.Parse("METAR EHAM 211125Z 24012G25KT 200V280 9999 -SHRA FEW012 BKN030CB 12/09 Q1013 TEMPO 4000 SHRA");

metar.Wind?.Direction         // 240
metar.Wind?.Gust?.Value       // 25
metar.Clouds[1].Type          // Cumulonimbus
metar.Pressure?.Hectopascals  // 1013
metar.FlightCategory          // Mvfr
metar.Describe(Language.Dutch)
METAR EHAM, waarneming dag 21 om 11:25 UTC
Wind:         240° met 12 kt, windstoten tot 25 kt, variërend tussen 200° en 280°
Zicht:        10 km of meer
Weer:         lichte regenbuien
Bewolking:    enkele wolken (1–2/8) op 1.200 ft, gebroken (5–7/8) op 3.000 ft met cumulonimbus
Temperatuur:  12 °C, dauwpunt 9 °C
QNH:          1013 hPa
Categorie:    MVFR
Trend:        tijdelijk: zicht 4.000 m; regenbuien

Why Cavok?

Most METAR libraries are written with US reports in mind. Cavok handles what European reports actually contain:

  • CAVOK, QNH in hectopascals, NSC, NCD and NSW
  • METAR trends — NOSIG, BECMG and TEMPO with FM, TL and AT
  • TAF change groups — FM, BECMG, TEMPO, PROB30, PROB40 and PROB30 TEMPO, plus TX/TN
  • Missing values from automatic stations (/////KT, ////, //////CB, 17///, RE//) without errors
  • Runway visual range, runway state (including CLRD and SNOCLO), wind shear, sea state and military colour states (BLU+BLU+, BLACKBLU+, TEMPO WHT)

US and other reports parse as well: statute miles (1 1/2SM), A2992, CLR, RMK. US TAF low-level wind shear groups (WS020/24040KT) are not supported yet and are reported as errors.

Features

  • Typed, immutable records for every group, with Parse (lenient) and ParseStrict (throws on errors)
  • Precise diagnostics: every problem has a stable code (CAV004), the offending text and its position, and a caret view:
    error CAV004: invalid visibility group "2400O"; expected 4 digits (e.g. 0800, 9999)
      METAR EHAM 211125Z 24012KT 2400O -RA FEW012 12/09 Q1013
                                 ^^^^^
    
  • Never throws on bad input: one broken group does not stop the rest of the report from being parsed
  • Flight category (VFR, MVFR, IFR, LIFR) for observations and every forecast block
  • Plain-language descriptions in English and Dutch
  • No dependencies; targets .NET Standard 2.0 and .NET 8

Install

dotnet add package Cavok

Usage

using Cavok;

Taf taf = Taf.Parse("TAF EHAM 210440Z 2106/2212 27005KT 9999 FEW035 BECMG 2106/2109 31011KT PROB30 TEMPO 2114/2118 TSRA");

foreach (TafChange change in taf.Changes)
{
    Console.WriteLine($"{change.Kind} {change.Probability} {change.Period}");
}

Console.WriteLine(taf.Describe(Language.English));

More examples are in the documentation.

How it is tested

  • Unit tests for every group type, including the ICAO Annex 3 examples and edge cases
  • Thousands of real METARs and TAFs from European aerodromes, fetched from the free aviationweather.gov Data API, must parse without errors
  • A check that every group in the corpus is either understood or reported — nothing is dropped silently
  • Snapshot tests of the parsed model and both descriptions for a diverse selection of reports
  • Property-based fuzzing with FsCheck: random strings, random sequences of report groups and mutated real reports never make the parser throw

Development

dotnet test                                               # all tests
CAVOK_FUZZ_CASES=10000 dotnet test                        # more fuzzing
dotnet run --project tools/Cavok.Corpus -- fetch          # add fresh reports to the corpus
dotnet run --project tools/Cavok.Corpus -- triage         # see what the parser reports on the corpus
CAVOK_ACCEPT_SNAPSHOTS=1 dotnet test                      # accept intended snapshot changes

License

MIT

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.1 98 9/23/2026
0.1.0 95 9/22/2026