This is a minimal weather microservice for cropboard.
Test it here
It serves little data like below
{
"lat": 3.8667,
"lon": 11.5167,
"temp": "298.96 F",
"pressure": "1017hPa",
"humidity": "67%",
"visibility": "10.0km",
"windSpeed": "1.88m/s",
"windDeg": 271,
"timezone": 3600,
"location": "Yaoundé",
"country": "CM",
"weather": "overcast clouds"
}
This information is used as the Weather
scalar for cropData
object.
First clone this repository
git clone https://github.com/cropboard/weather-server
Then change directory into it
cd weather-server
Go to openweathermap and create an account along with an API key.
Create a .env
file and add the following inside
OPENWEATHERMAP_API_KEY=<YOUR_API_KEY>
Install requirements by typing the following in your terminal
pip install -r requirements.txt
Now run with
uvicorn main:app --reload
Navigate to /<CITY-NAME>
to view weather data for a city.