Weather.NET
1.1.1
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Weather.NET --version 1.1.1
NuGet\Install-Package Weather.NET -Version 1.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="Weather.NET" Version="1.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Weather.NET --version 1.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Weather.NET, 1.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.
// Install Weather.NET as a Cake Addin
#addin nuget:?package=Weather.NET&version=1.1.1
// Install Weather.NET as a Cake Tool
#tool nuget:?package=Weather.NET&version=1.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Weather.NET
A simple .NET library that uses OpenWeatherMap API to get the weather of different places and cities. Supports both synchronous and asynchronous methods.
Example
using System;
using Weather.NET;
using Weather.NET.Enums;
using Weather.NET.Models.WeatherModel;
...
WeatherClient client = new WeatherClient("Your API key");
// Gets a forecast of the London weather asynchronously, using the city name.
List<WeatherModel> forecasts = await client.GetForecastAsync("London", 8, Measurement.Metric, Language.Spanish);
Console.WriteLine(forecasts[7].Weather[0].Description);
// Gets the current temperature of New York synchronously, using the ZIP Code.
WeatherModel currentWeather = client.GetCurrentWeather("10001", "US", measurement: Measurement.Imperial);
Console.WriteLine(currentWeather.Main.Temperature);
// Gets maps of the entire world.
client.DownloadWeatherMap("temperatureMap.png", MapLayer.Temperature, 0, 0, 0);
await client.DownloadWeatherMapAsync("pressureMap.png", MapLayer.Pressure, 0, 0, 0);
...
Version 1.1.0
There's no new features, but the code is now more readable, and there are two breaking API changes:
- Now the library's code is cleaner and easier to use with the WeatherClient class.
- Models.WeatherResponse is now called Models.WeatherModel.WeatherModel and it's now serializable.
- Both the README and the official website contain a small tutorial on how to use the library.
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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- Newtonsoft.Json (>= 13.0.1)
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 | |
---|---|---|---|
1.3.3 | 250 | 11/19/2023 | |
1.3.2 | 1,267 | 8/21/2022 | |
1.3.1 | 418 | 7/20/2022 | |
1.3.1-beta.1 | 120 | 7/15/2022 | |
1.3.0 | 413 | 1/3/2022 | |
1.2.1 | 250 | 12/22/2021 | |
1.2.0 | 256 | 12/20/2021 | |
1.1.1 | 286 | 12/17/2021 | |
1.1.0 | 256 | 12/16/2021 | |
1.0.0 | 244 | 12/10/2021 | |
0.3.0 | 299 | 12/9/2021 | |
0.2.0 | 300 | 12/8/2021 | |
0.1.0 | 380 | 12/5/2021 |
- Now the ZIP Code needs to be a string instead of a long, to account for different ZIP formats in different countries.
- Now the Weather.NET logo looks normal.