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)

Комментарии • 5

  • @emmyemeraldwolf9598
    @emmyemeraldwolf9598 3 года назад +2

    Good job

  • @ravdeepkour5356
    @ravdeepkour5356 3 года назад

    Helpful video🙏🙏

  • @nikhileshshah361
    @nikhileshshah361 3 года назад +2

    keep it up the great work ❤❤

  • @opiritetariah
    @opiritetariah 2 года назад

    Pls how can i retrieve forecast data for 5/7 days

    • @funtocode5904
      @funtocode5904  2 года назад

      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)