GithubHelp home page GithubHelp logo

kamiderka / weather-forecast-api Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 29 KB

[BACKEND] Get the weather forecast and energy production for the next 7 days using an OpenMeteo API

Home Page: https://weather-forecast-api.azurewebsites.net/forecast

License: MIT License

Python 95.83% Dockerfile 4.17%
fastapi openmeteo-api python3 renewable-energy

weather-forecast-api's Introduction

Weather (and Energy) Forecast API

DescriptionRunEndpoints

Description

An application to display the weather forecast for the next 7 days using an external API. Additionally, the application estimates the forecasted energy production from a photovoltaic installation.

Run

From repository

git clone https://github.com/kamiderka/weather-forecast-api.git
cd weather-forecast-api
pip install -r requirements.txt
fastapi run src/main.py

From Dockerfile

git clone https://github.com/kamiderka/weather-forecast-api.git
cd weather-forecast-api
docker build -t toringen/weather-forecast-api:latest .
docker run -p 8080:8080  toringen/weather-forecast-api:latest

Pull image from DockerHub

docker pull toringen/weather-forecast-api:latest
docker run -p 8080:8080  toringen/weather-forecast-api:latest

or... you can contact me to get URL to my Azure deployment

Endpoints

Unfortunately there is only one (but still amazing) endpoint:

GET /forecast

Get the weather forecast and estimate energy production from a photovoltaic installation for the next 7 days based on specified latitude and longitude coordinates.

Query Parameters

Name Required Type Description
latitude required float Supported values: <-90.0;90.0>
longitude required float Supported values: <-180.0;180.0>

Response

[
    {
        "date": "2024-05-15T00:00:00+00:00",
        "weatherCode": 80,
        "temperatureMax": 28,
        "temperatureMin": 27,
        "energy": 5.24
    },
    
]

or

{
    "detail": "Latitude should be in range <-90°:90°>. Given: 1223.0"
}

weather-forecast-api's People

Contributors

kamiderka avatar

Watchers

 avatar

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.