izolabella.OpenWeatherMap.NET
4.0.1
dotnet add package izolabella.OpenWeatherMap.NET --version 4.0.1
NuGet\Install-Package izolabella.OpenWeatherMap.NET -Version 4.0.1
<PackageReference Include="izolabella.OpenWeatherMap.NET" Version="4.0.1" />
paket add izolabella.OpenWeatherMap.NET --version 4.0.1
#r "nuget: izolabella.OpenWeatherMap.NET, 4.0.1"
// Install izolabella.OpenWeatherMap.NET as a Cake Addin
#addin nuget:?package=izolabella.OpenWeatherMap.NET&version=4.0.1
// Install izolabella.OpenWeatherMap.NET as a Cake Tool
#tool nuget:?package=izolabella.OpenWeatherMap.NET&version=4.0.1
🌦️ izolabella.OpenWeatherMap.NET
A library for communicating with the OpenWeatherMap API.
Used mostly because I like to know when it rains and enjoy having the convenience of seeing the weather in places other than a dedicated app.
👩💻 Getting Started
This project is available through NuGet.org;
- Package Manager (Visual Studio)
Install-Package izolabella.OpenWeatherMap.NET
- .NET CLI
dotnet add package izolabella.OpenWeatherMap.NET
⌨️ Code
A new instance of the OpenWeatherMapClient
class must be initialized. This can be done while providing the AppId
argument in the constructor immediately or the AppId
can be set later, but if it isn't set before you attempt calling a method, the client will throw an Exception
. This class also supports a specific unit type.
OpenWeatherMapClient Client = new("App Id", UnitTypes.Metric);
Various methods of communicating with the API are provided through processors used for different parts of the API.
. . .
WeatherResponse? Response = await Client.Processors.CurrentWeatherDataProcessor.GetWeatherByZipCodeAsync("00000", "US");
// WeatherResponse is a class containing generic, current weather information.
. . .
. . .
OneCallWeatherResponse? OneCallWeatherResponse = await Client.Processors.OneCallProcessor.CallAsync(0.0m, 0.0m);
// OneCallWeatherResponse is a class containing all possible relevant weather information regarding the given coordinates.
. . .
The WeatherResponse
object might not always be null if an error has occurred (such as an invalid zipcode), check the Cod
object for a 2xx http status code if necessary. Specific error types will more than likely be added later.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. 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 was computed. 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. |
-
net6.0
- Microsoft.CSharp (>= 4.7.0)
- Newtonsoft.Json (>= 13.0.1)
- System.Data.DataSetExtensions (>= 4.5.0)
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 |
---|
Fixed JSON errors, fixed unit type not actually sending the current units.