How to Build a Weather App with Python | Weather API

Поделиться
HTML-код
  • Опубликовано: 10 фев 2025
  • Hey guys, welcome back! In this video, I will be walking you through how to develop a weather app using the Python programming language. We'll use the OpenWeatherMap API to retrieve weather data and use the requests library in Python to fetch the weather API.
    Code in this video: github.com/arp...
    If you don't know about Python, Python is a high-level programming language that is used to create computer applications. It is an interpreted language, meaning that it can be executed by the interpreter without having to go through a compilation process. Python can be used in many different fields including web development, data science, and artificial intelligence.
    If you don't know about APIs, I'd recommend checking these videos out:
    API Fetching with React - • How to Fetch APIs With...
    API Fetching with Python - • How to Fetch APIs with...
    My GitHub: github.com/arp...
    My Website: arpanneupane.com
    Background Music: • LAKEY INSPIRED - Warm ...
    My Programming Gear :
    Keyboard: amzn.to/42vXkxh
    Laptop: amzn.to/3CkAP3W
    Laptop Stand: amzn.to/3X116Oi
    Desk: amzn.to/43wmIEt
    Monitor: amzn.to/42BAaFH
    Monitor Arm: amzn.to/3NR0APS
    Chair: amzn.to/42vvKAn
    Desk Mat/Mousepad: amzn.to/43AhKqj
    Microphone: amzn.to/45RuQ43
    Headphones: amzn.to/445sf4R
    #Programming // #WeatherApp // #LearnToCode

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

  • @sudeep812
    @sudeep812 3 года назад +22

    Clean code and a very nicely explained.keep it up Arpan.

  • @ФёдорСмирнов-п1о
    @ФёдорСмирнов-п1о Год назад +2

    Thank you for clear introduction to the weather app in python. I'll try myself to develop the fundamentals I got from this video

  • @Native_love
    @Native_love Год назад +2

    Thank you! This worked! The other RUclips videos by others had too many errors in them. Thank you!!!

  • @newbie6449
    @newbie6449 Год назад

    simple short and to the point info.
    Thanks man

  • @Tictacpanter
    @Tictacpanter 25 дней назад

    Nice explanation. Thanks!

  • @miltonneto2985
    @miltonneto2985 2 года назад +4

    Thanks, your video helped me understand how to round numbers to decimals

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

      👍

    • @yosef_ii
      @yosef_ii 6 месяцев назад

      Wait what??

    • @miltonneto2985
      @miltonneto2985 6 месяцев назад

      @@yosef_ii I couldn't understand how I rounded decimal numbers and my colleague's video helped me understand how

    • @yosef_ii
      @yosef_ii 6 месяцев назад

      @@miltonneto2985 Yeah it's just rounding decimals give you integers and in your comment you said numbers to decimals which is reversed yk what i mean

    • @miltonneto2985
      @miltonneto2985 6 месяцев назад +1

      @@yosef_ii True lol, I remember that day I was very stressed because I couldn't round the decimal numbers, I think that ended up causing this confusion 🤣

  • @Crazy4busesReview-PD4106
    @Crazy4busesReview-PD4106 Год назад

    Excellent video!

  • @fouadmaizar2914
    @fouadmaizar2914 3 года назад +1

    Thanks man for the explanation.

  • @feralrootsfarm
    @feralrootsfarm 2 года назад +1

    Thank you. Awesome!

  • @sixer-me6jz
    @sixer-me6jz 2 года назад

    It very helpful in my development of my discord bot thanks bro!

  • @GopiNath-uk8ib
    @GopiNath-uk8ib Год назад

    Simple and Sweet 😊
    Thank You 😊

  • @NNNedlog
    @NNNedlog 2 года назад +1

    This is very nice. Thanks for sharing

  • @saadalsaidy3712
    @saadalsaidy3712 9 месяцев назад

    that was great thank you very much

  • @sudeep812
    @sudeep812 3 года назад +1

    Very good !!!

  • @ausbirdy
    @ausbirdy 3 года назад +1

    You are awesome!

  • @Wanetopia
    @Wanetopia Год назад +8

    Nice!
    I'm a student In Kenya, this was very informative.
    I was wondering if there is a way we can merge this with Kotlin so that this data is displayed using beautiful, responsive UI on an android device...
    If you could do that on another video I'd really appreciate.
    Otherwise, thank you!

  • @declanmalone1279
    @declanmalone1279 6 месяцев назад +1

    Pip install requests doesnt work for me in Windows. What is the exact command?

  • @emreboy0337
    @emreboy0337 Год назад

    Could you please make a video in which you run this code in tkinter?? (or are you already have that?) I need that soo muchhh pleasee

  • @AHDD142
    @AHDD142 2 года назад +1

    Thanks man. Do you know why it does not work this way please?: if weather_data.json()['cod'] != '200' like why it does work for 404 but not 200?

  • @NebaMcbright
    @NebaMcbright 10 месяцев назад

    Please could you give me the name of the software you used to write the code and how it was possible for it to show in the browser.

  • @jabarhenv5933
    @jabarhenv5933 Год назад +1

    I had to copy the http part straight from your github but why is it when I tried to copy and paste it from the weather app did it not give me the same url?

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

    How do I change 10 digit time format to hour time such as sunrise or sunset? Thank you

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

    Nice video😁😁
    One question when I put Celsius de result still in farenheit, how can I change it?

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

      you can use the Farenheit to Celcius formula and then use that to change the value for the temperature before you print it out.

    • @yuryaraujo8325
      @yuryaraujo8325 Год назад

      You can change line 14 to this: temp = round((weather_data.json()['main']['temp'] - 32) * (5 / 9))

    • @towkukus
      @towkukus Год назад

      Line 8 of authors code is the URL to openweather. Replace units=imperial with units=metric

  • @SamirDinkha-i9l
    @SamirDinkha-i9l Год назад +1

    I am getting error code 401 Unauthorized, but I verified my e-mail. What do you think?

    • @JAMESSAN117
      @JAMESSAN117 Год назад

      Same issue here, maybe we have to wait.

    • @lokesh5664
      @lokesh5664 Год назад

      I am also getting error code 401 how to resolve it

    • @satadrunaskar8993
      @satadrunaskar8993 6 месяцев назад

      ​@jamess.9930, was your issue solved ? Actually I contacted them and they are telling me to wait for a few hours.

  • @verysmolbean
    @verysmolbean 9 месяцев назад +1

    The console says my api key is invalid when i print out the data.json

    • @TripleAAA_54
      @TripleAAA_54 Месяц назад

      Reload the page it worked for me

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

    Confused about weather = weather_data.json()['weather'][0]['main']
    Why do we have to access this using a 0 index but everything else you can just call like how temp is done?

    • @ArpanNeupaneProductions
      @ArpanNeupaneProductions  2 года назад +1

      Because you have to access the first index of the returned data in order to access the weather itself. You can see that in the data that is returned from the API if you send a GET request to that endpoint.

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

    Is is possible to run this code in IDLE PYTHON?

  • @Bookworm2702
    @Bookworm2702 3 месяца назад

    Can someone please tell why after printing the “weather_data.status_code”, i am getting 404 instead of 200

    • @Gojou260
      @Gojou260 2 месяца назад

      cuz web-site changed the way you search the state, ig

  • @Egsslereal
    @Egsslereal Год назад

    PLEASE SAY HOW TO TRANSLATE WEATHER AND TEMP

  • @jaychou8430
    @jaychou8430 2 года назад +1

    Where I can find my URL?

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

    How do you get the URL that you insert?

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

      I copied and pasted it. You can go to the openweathermap.org to learn more about the API.

  • @Akash-rj8te
    @Akash-rj8te 7 месяцев назад

    you did'nt explain the url

  • @sammmammm
    @sammmammm Год назад

    how to turn it into GUI

  • @tmusic1001
    @tmusic1001 Год назад +4

    I got 401. what to do

    • @lorddagf7978
      @lorddagf7978 Год назад +3

      I don't know if you were able to figure it out but for me I had to wait about 10 minutes for api key to be enabled.

    • @tmusic1001
      @tmusic1001 Год назад +3

      @@lorddagf7978 I did it thanks👌

    • @jorglopez4744
      @jorglopez4744 8 месяцев назад

      How to solve this 401?

  • @tala_aa2993
    @tala_aa2993 Год назад

    where is the url?

  • @anujdhanke
    @anujdhanke 10 месяцев назад

    It shows KeyError : 'weather'

    • @AzimMukith
      @AzimMukith 6 месяцев назад +1

      I get this error when I use the key that was given for my account. However, when I use the key in his github it works fine. Not sure why

  • @priy3865
    @priy3865 Год назад

    Thankyou so much it was very useful for me..✨🫰

  • @olasojiemmanuel9132
    @olasojiemmanuel9132 Год назад

    Please how did you get the url for the weather_data?