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
Clean code and a very nicely explained.keep it up Arpan.
Thank you !!
Thank you for clear introduction to the weather app in python. I'll try myself to develop the fundamentals I got from this video
Thank you! This worked! The other RUclips videos by others had too many errors in them. Thank you!!!
simple short and to the point info.
Thanks man
Nice explanation. Thanks!
Appreciate it!
Thanks, your video helped me understand how to round numbers to decimals
👍
Wait what??
@@yosef_ii I couldn't understand how I rounded decimal numbers and my colleague's video helped me understand how
@@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
@@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 🤣
Excellent video!
Thanks man for the explanation.
You're welcome!
Thank you. Awesome!
Glad I could help!
It very helpful in my development of my discord bot thanks bro!
Simple and Sweet 😊
Thank You 😊
This is very nice. Thanks for sharing
Thank you! Cheers!
that was great thank you very much
Very good !!!
Thanks!
You are awesome!
Appreciate it!
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!
Pip install requests doesnt work for me in Windows. What is the exact command?
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
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?
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.
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?
same question
How do I change 10 digit time format to hour time such as sunrise or sunset? Thank you
Nice video😁😁
One question when I put Celsius de result still in farenheit, how can I change it?
you can use the Farenheit to Celcius formula and then use that to change the value for the temperature before you print it out.
You can change line 14 to this: temp = round((weather_data.json()['main']['temp'] - 32) * (5 / 9))
Line 8 of authors code is the URL to openweather. Replace units=imperial with units=metric
I am getting error code 401 Unauthorized, but I verified my e-mail. What do you think?
Same issue here, maybe we have to wait.
I am also getting error code 401 how to resolve it
@jamess.9930, was your issue solved ? Actually I contacted them and they are telling me to wait for a few hours.
The console says my api key is invalid when i print out the data.json
Reload the page it worked for me
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?
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.
Is is possible to run this code in IDLE PYTHON?
Yes
Thanks a lot ... Can u pls provide your insta I'd ?? Pls i got some error ...
I got atleast output properly only by this video ... I had watched a no.of videos but no video helped me like these ... Thank you so much
@@lakshmipriya925 @imarpanneupane
@@lakshmipriya925 Appreciate it!
Can someone please tell why after printing the “weather_data.status_code”, i am getting 404 instead of 200
cuz web-site changed the way you search the state, ig
PLEASE SAY HOW TO TRANSLATE WEATHER AND TEMP
Where I can find my URL?
How
How do you get the URL that you insert?
I copied and pasted it. You can go to the openweathermap.org to learn more about the API.
you did'nt explain the url
how to turn it into GUI
I got 401. what to do
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.
@@lorddagf7978 I did it thanks👌
How to solve this 401?
where is the url?
It shows KeyError : 'weather'
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
Thankyou so much it was very useful for me..✨🫰
Please how did you get the url for the weather_data?
thinking about the same thing