Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/piksel/SMHISharp
Library for querying SMHI Open Data API for .NET
https://github.com/piksel/SMHISharp
Last synced: 29 days ago
JSON representation
Library for querying SMHI Open Data API for .NET
- Host: GitHub
- URL: https://github.com/piksel/SMHISharp
- Owner: piksel
- License: mit
- Created: 2017-04-13T18:02:24.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-19T00:51:25.000Z (over 6 years ago)
- Last Synced: 2024-10-13T14:35:26.533Z (2 months ago)
- Language: C#
- Homepage:
- Size: 40 KB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-sweden - C#
README
# SMHISharp
Library for querying SMHI Open Data API for .NET![Example application](https://i.imgur.com/h3dUvYR.png)
## Installation
Install from nuget:
```Install-Package SMHISharp```## Usage
```cs
var client = new Piksel.SMHISharp.ApiClient();// Print all resources
client.GetResources(resources => {
Console.WriteLinte("Resources:");
foreach(var resource in resources){
Console.WriteLine(" {resource.Key}: {resource.Title}");
}
});// Print all stations for resource 1
var resourceKey = "1"; // momentanvärde, 1 gång/tim
client.GetStations(resourceKey, stations => {
Console.WriteLinte("Stations:");
foreach(var station in stations){
Console.WriteLine(" {station.Key}: {station.Title}");
}
});client.GetPeriods(resourceKey, stationKey, periods => {
...
});// Note: GetData can fail
client.GetData(resourceKey, stationKey, periodKey, (dataPoints, exception) => {
...
});
```