Swiftpack.co -  Package - bmonty/AvWeather
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
bmonty/AvWeather
Swift package to process data from aviationweather.gov.
.package(url: "https://github.com/bmonty/AvWeather.git", from: "0.0.7")

AvWeather

AvWeather is a Swift package allowing you to retrieve and use data from aviationweather.gov.

Usage

import AvWeather

let avWeatherClient = ADDSClient()

// send a request for METAR data for Boston Logan Airport (KBOS)
avWeatherClient.send(MetarRequest(forStation: "KBOS")) { response in 
    switch response {
    case .success(let metars):
        // do something with new METAR data
        print(metars[0].rawText)
        
    case .failure(let error):
        // request failed
        print(error.localizedDescription)
    }
}

// send a request for METAR data at multiple stations
avWeatherClient.send(MetarRequest(forStations: ["KBOS", "KORD", "KLAX"])) { response in
    switch response {
    case .success(let metars):
        // do something with new METAR data
        print(metars[0].rawText)
        
    case .failure(let error):
        // request failed
        print(error.localizedDescription)
    }
}

GitHub

link
Stars: 0
Last commit: 42 weeks ago

Release Notes

Request multiple stations
42 weeks ago

Adds the ability to request data for multiple stations in a single request.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco