Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shingzhanho/hkosharp
Unofficial C# Library of Hong Kong Observatory API
https://github.com/shingzhanho/hkosharp
api cross-platform csharp csharp-library hong-kong open-source unofficial weather weather-api weather-data weather-forecast
Last synced: about 1 month ago
JSON representation
Unofficial C# Library of Hong Kong Observatory API
- Host: GitHub
- URL: https://github.com/shingzhanho/hkosharp
- Owner: ShingZhanho
- License: gpl-3.0
- Created: 2020-08-19T13:39:36.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2020-09-08T07:07:30.000Z (about 4 years ago)
- Last Synced: 2024-10-12T14:21:42.756Z (about 1 month ago)
- Topics: api, cross-platform, csharp, csharp-library, hong-kong, open-source, unofficial, weather, weather-api, weather-data, weather-forecast
- Language: C#
- Homepage: https://hkosharp.shingzh.eu.org/
- Size: 3.6 MB
- Stars: 42
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
C# Library of Hong Kong Observatory Open Data API# What is HKOSharp?
HKOSharp is a C# library which allows you to access the Hong Kong Observatory Open Data API without handling bunches of Http requests, responses or JSON.
# Todo list
1. Update documentation for a recent rewrite.
2. Translate document into Chinese Traditional and Chinese Simplified.
3. Finish Weather class.
4. ~Move from CircleCI to Travis CI.~ (Succeesfully moved to GitHub Workflow)
5. Increase Code Coverage# Build
To build the project, you need to:
1. Clone the repo to your machine.
2. Open the `.sln` file with your favourite IDE.
3. That's it!# Installation
To use HKOSharp in your project, there are several ways to do so:
* Build the project and import the `.dll` files manually;
* Install from [NuGet Package Manager](https://www.nuget.org/packages/HKOSharp/);# Usage
For the full usage of HKOSharp, you should check [HKOSharp Documentations](https://hkosharp.shingzh.eu.org).
> **WARNING: Library were rewritten recently and documentation may not be up-to-date.**Here are some examples of usages of HKOSharp:
```c#
// Imports namespace
using HKOSharp.LibHKOSharp;
``````c#
// Gets today's Local Weather Forecast
var localForecast = Weather.GetLocalForecast(Language.English);
Console.Write("Description of today's forecast: ");
Console.Write(localForecast.ForecastDesc);
// Output:
// Description of today's forecast: Under the influence of an anticyclone aloft, the weather is ...
``````c#
// Gets latest Earthquake information
var eqInfo = Earthquake.GetLatestEqInfoAsnyc(Language.TraditionalChinese);
Console.Write("Latest Earthquake Report Region: ");
Console.Write(eqInfo.Region);
// Output:
// Latest Earthquake Report Region: 班達海
```# Dependencies
* [Newtonsoft.Json](https://github.com/JamesNK/Newtonsoft.Json)
* .NET Standard 2.0