Git Product home page Git Product logo

open-meteo-dotnet's Introduction

🌡️🌤️ Open-Meteo Dotnet Library

build and test GitHub license Nuget

A .Net Standard library for the Open-Meteo API.

❕ Information

This project is still in development. There will be major changes in the codebase.

🎯 Roadmap

  • Documentation and wiki
  • Throw exceptions instead of returning null (v0.2)

🔨 Installation/Build

NuGet

NuGet Package

Use NuGet Package Manager GUI. Or use NuGet CLI:

dotnet add package OpenMeteo.dotnet

Build

Alternatively you can build this library on your own.

  1. Clone this repo:
git clone https://github.com/AlienDwarf/open-meteo-dotnet
  1. Open the project and build it. The build process will create a .dll file in /bin/[CONFIGURATION]/netstandard2.1/

  2. Add a reference in your own project to the .dll in your own project.

  3. Add using OpenMeteo; to your class.

💻 Usage

Minimal:

using OpenMeteo;

static void Main()
{
    RunAsync().GetAwaiter().GetResult();
}

static async Task RunAsync()
{
    // Before using the library you have to create a new client. 
    // Once created you can reuse it for every other api call you are going to make. 
    // There is no need to create multiple clients.
    OpenMeteo.OpenMeteoClient client = new OpenMeteo.OpenMeteoClient();

    // Make a new api call to get the current weather in tokyo
    WeatherForecast weatherData = await client.QueryAsync("Tokyo");

    // Output the current weather to console
    Console.WriteLine("Weather in Tokyo: " + weatherData.CurrentWeather.Temperature + "°C");
    
    // Output: "Weather in Tokyo: 28.1°C
}

For more examples visit the Wiki example page.

License

This project is open-source under the MIT license.

Appendix

This library uses the public and free available Open-Meteo API servers. See also:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.