Get weather using Python I Using pyowm librarby I Working with API I Easy and basic tutorial I
HTML-код
- Опубликовано: 18 сен 2024
- This is a very easy and basic tutoria that show how you can use API to get weather data in python. We are using pyowm library. Comment below what videos you want me to make and any questions you have.
Link to python spyder that I am using:
www.spyder-ide...
Link to openweather website:
openweathermap...
My code:
from pyowm import OWM
owm = OWM('your API key')
mgr = owm.weather_manager()
observation = mgr.weather_at_place(input("Enter the city and country short form: "))
w = observation.weather
print(w.detailed_status)
print(w.wind())
print(w.humidity)
print(w.temperature('celsius'))
print(w.rain)
print(w.heat_index)
print(w.clouds)
Good job
Helpful video🙏🙏
keep it up the great work ❤❤
Pls how can i retrieve forecast data for 5/7 days
Hey there, try this code and let me know if it worked
import requests
api_address = "api.openweathermap.org/data/2.5/forecast? appid=your api key"
city = input("city name :")
url=api_address+city
j_data=requests.get(url).json()
print(j_data)