✅ In 5 steps | Using weather api in Python to get weather-report of any place | Python project API

Поделиться
HTML-код
  • Опубликовано: 4 фев 2025

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

  • @Odinwain
    @Odinwain 3 года назад +7

    Wow thank you for taking the time to explain this video, Now I wish my professors gave this good of instructions!

  • @aneeshsha5097
    @aneeshsha5097 2 года назад +2

    LOVE your explanation Brother i totally understand the concept .... just amazing

  • @022_ananyasrivastava8
    @022_ananyasrivastava8 3 года назад +2

    Usually I don't comment. But this is something which I found mind-blowing. Hatts off

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

      Thank you so much for your fantastic word. It gives a lot of boost to do more such work. 👍

    • @022_ananyasrivastava8
      @022_ananyasrivastava8 3 года назад +1

      @@aipython Can u plz tell how can I design GUI for this project

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

      You can use either Tkinter or pyqt5 to create a GUI in python and assign the buttons with corresponding api call. You could check out on my channel- project for covid 19 vaccine availability checker. ruclips.net/p/PLBeeFF3JmXWA-l4xv2TyCU1DnJGsoHseJ

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

    Woww amazing 🎉 The concept amazing, everyone used to directly write the code but you are really amazing, feeling like i am making it by myself woww🎉

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

      I am glad it helped you.

  • @BluePhantomStudio
    @BluePhantomStudio 3 года назад +3

    Now I can implement it in my Voice Assistant thanks

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

    Best explanation available on the internet for beginners 💝🤝🤝

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

      Great to hear this from you

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

    this is what ive been looking for, great explanation!!

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

    thanks alot for explaining it in slow pace and using simpler terms bro

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

      I am glad it helped you. Thanks 🙏

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

    I like your voice and the way you describe thank you

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

    Very helpful. Thank you so much for posting this.

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

      Glad , it helped you

  • @cweeperyt
    @cweeperyt 4 года назад +4

    Very good Video! Thank you for explaining👍

  • @EchoPlay-n1f
    @EchoPlay-n1f Год назад +1

    you are the best man thanks so much

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

    Thank you so much you saved my final semester project ❣️❣️❣️❣️❣️☺️☺️☺️☺️☺️❣️☺️❣️❣️❣️☺️❣️❣️

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

      Great, it worked for you.

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

      Yes for that reason i message you on Instagram but i got my output after that

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

    your voice so soothing. Thanks for this video. I am using this in my project now

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

      Nice to hear that 😊

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

      Can u help me
      I have error in this project

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

      Can you please let me know what is the error??

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

    Awesome ❤❤❤❤

  • @rutujanalawade2689
    @rutujanalawade2689 4 года назад +1

    Well explained video. thank you sir

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

    when i running the code the keyerror is "API "key line
    please solve this problem (string number 5)

  • @talalahmed7265
    @talalahmed7265 2 года назад +2

    key error = "main" what should I do?

  • @ramdevakumar7811
    @ramdevakumar7811 4 года назад +7

    This is a pretty good video. Thank you for the amount of effort you put in it.

    • @aipython
      @aipython  4 года назад

      Thank you for such a nice feedback. This is motivating to do more.

    • @ramdevakumar7811
      @ramdevakumar7811 4 года назад +1

      @@aipython I would recommend doing a video on another api.

    • @aipython
      @aipython  4 года назад

      We are working on it, by the way would you like us to make video on any specific api service. Anything in your mind?

    • @ramdevakumar7811
      @ramdevakumar7811 4 года назад

      @@aipython No not really.

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

    THANK YOU ❤️

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

    Great Video Man, Keep Posting

  • @Anitakumari-hx4tl
    @Anitakumari-hx4tl 3 года назад

    Awesome explanation 👍

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

    Great video
    You deserve a like and a sub

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

    very nice

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

    Why [0] is added to access sub elements of weather ? You haven't used the same rule to access sub elements of MAIN

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

      Where exactly in the code, any line number?

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

      @@aipython Line No. 20 Weather [0]
      Line No 21... no zero. Here sub element is accessed without [0].
      Thank you for the prompt response.

  • @jaytaro._fx4725
    @jaytaro._fx4725 5 месяцев назад +1

    does this require an internet connection>?

    • @aipython
      @aipython  5 месяцев назад

      Yes of course, to fetch the data over API

    • @jaytaro._fx4725
      @jaytaro._fx4725 5 месяцев назад

      @@aipython ok thanks

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

    Finally found a good video

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

    thank you for the good video, while i have a question about about the used api. can it let us to get the precipitation value and the soil moisture value or it is just used to get the temprature, humidity and speed values?

    • @aipython
      @aipython  4 года назад +1

      Hey Najla,
      Thank you for liking the video. I am not sure if it would give you the soil moisture, as it would require a dedicated sensor to be placed inside the soil at each specific location (trust me it's a very very tedious task for any organisation). But I am sure that api must have precipitation value. Best of luck and let me know for any other help.

    • @najlafattouch5208
      @najlafattouch5208 4 года назад

      @@aipython thank you so much for your generosity :)

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

    Hello aipython, I wanted to develop a project that is a weather prediction system. I wanted to ask that how can I predict weather in upcoming days that whether it will be sunny or cloudy or what will be the temperature and all?

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

      Yes, definitely you can build one such app. So the idea is pretty simple and can be implemented easily using Machine learning (specifically using Decision Tree). You can build model by aggregating past 4-5 year data of a place. Build a ML model and save the output of model result in a file and finally create GUI to display the future prediction.

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

    Sir can we convert this into an app for Android??

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

    Awesome video..

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

    do you have a weather forecast project report

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

    Should we put API key in brackets or nt

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

    In which app u r running this problem? It's showing no module name requests

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

    What actually written in current_weather_data in environment variable ?plz tell me .

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

      You need to obtain a API key from openweathermap website and put it there in environment field

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

      @@aipython Ok Tnx👍

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

    when I run my code and give it my city it returns '400',i searched it and it means bad request! I don't know what to do
    plsss heeelp

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

    Brother can you explain me i'm first year student how to start and implement this project which text editor or what i need to build this project

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

      You can follow the videos and use any code editor you are familiar with. Incase you are starting fresh then consider VS code and python version 3.9 or above.

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

    The open weather map API has changed it's API call, will this video work there as well?

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

      Hey Krunal, to be very frank, I haven't seen the new api structure. I will confirm you after verification. Give me some time

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

    Hlo sir I am getting KeyError: 'main' from temp_city please telll me what to do

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

      Hi Rakshith,
      I have seen your email, there you have just attach the error portion. Can you send your complete code alongwith the error details. I will debug and let you know the solution.
      Keep learning and keep growing!!

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

      @@aipython thank you sir I have sent you the email

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

      @@rakshith9584 even I am geting the same error , do you know how to remove it ?

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

    Bro the code is not running instead its showing : raise KeyError(key) from None
    KeyError: 'current_weather_data'
    Plzz helpp!!

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

      It is straight forward, you have not created any variable with the name 'current_weather_data' in the environment variable.
      Please create one with this name and add your api key in the value field.

  • @Vaikartana24
    @Vaikartana24 11 месяцев назад

    isnt working. the site has changed completely can't generate api keys.

  • @anshugulati9165
    @anshugulati9165 4 года назад +1

    i am given a project on weather forecasting but not an app based but web based ,i think this one u showed would be considered as app based so can u please suggest me what could i do for it.

    • @aipython
      @aipython  4 года назад +1

      Hi Anshu,
      You can build an front end (web app) using either flask or electron Js and keep this code at the back end. Display the result on that app.

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

    Can we show this Jeson data into Web browser in Graphical way ? Please reply how ?

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

      You can view JSON data in web browser using a plugin called json formatter. Video link: ruclips.net/video/99UUOxhiyDk/видео.html
      I am not sure about displaying the same in Graphical format. You can search some online json viewer

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

    Very good video! Is there a possibility to get the weather of a place for 2014?

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

      Thank you.
      I would say yes, there is possibility to get weather info from past , if the api stores previous data as well. I will check and update you.

  • @logics8529
    @logics8529 4 года назад

    keep it up bro

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

    Can we save this data into csv

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

      Yes, ofcourse
      We can save all the data into Excel sheet using openpyxl module

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

    thanks you but while i am running it its saying: KeyError: 'current_weather_data'

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

      That means, Python is not able to locate "current_weather_data" in the environment variable. You need to create such variable and assign the API key to it.. it is clearly explained in the video

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

      @@aipython ok thank you :D

  • @wernerdebarros
    @wernerdebarros 4 года назад +1

    How can i do a graph with quiver forecast like windy?

    • @aipython
      @aipython  4 года назад +1

      I am not sure, if I understand you correctly. Did you mean to plot a graph for windy weather showing over some range let say 1 day or 2.

    • @wernerdebarros
      @wernerdebarros 4 года назад

      @@aipython Hey, I am try to do a graph like windy with fews files netcdfs. Can i send email, linkedin or whatsapp?

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

    How can I see how much it has rained today?

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

      You can check, if such information is available within the response provided by API service provider. If they are providing such data , well than good news is you can get it too.

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

    HOW CAN I FIX THIS ModuleNotFoundError: No module named 'requests'

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

      Have you installed the requests module along with python?

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

      Where can i download that?

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

      You can refer to this video: ruclips.net/video/5V713heaUE8/видео.html

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

      @@aipython will i download all ?

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

      Not exactly, only requests is required

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

    can we use this project in our final year....

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

      Yes, of course go ahead and take all the code available on our website www.aipython.in

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

    Can i use jupyter notebook (anaconda3) to run this?

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

    Sir how to get output in simple notepad for this code?

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

      Yes, you can write the information in a text file and that can be done pretty easily.

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

    are u store some data in api-user r not

  • @NameisAizen
    @NameisAizen 4 года назад +1

    Which flatform you run the program

    • @aipython
      @aipython  4 года назад

      I am using Notepad++ to execute Python code. Here is the video, which explain how to use Notepad++ for Python. ruclips.net/video/yxTbSTrCn6I/видео.html

    • @NameisAizen
      @NameisAizen 4 года назад

      I getting syntax error

    • @NameisAizen
      @NameisAizen 4 года назад

      8 th line....got error

    • @NameisAizen
      @NameisAizen 4 года назад

      I am doing project on weather api using machine learning.... could you please help me sir

    • @aipython
      @aipython  4 года назад

      Share the error screenshot at aipython.india@gmail.com

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

    can we use pycharam sir

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

      Yes, Sakib.
      You can definitely use pycharm or any other IDE

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

      Sir I have run the project but error shows
      raise keyerro(key)from none

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

    Hey bro can you please share the synopsis or project report of this..

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

      Sorry, Its not available right now

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

    can we get monthly data by this API ...plz ansr asap....thank you.

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

      Of course, why not.. you can get historical data in various forms BUT not via this API. openweathermap provided many other API to facilitate data delivery.

  • @kazimrizvi486
    @kazimrizvi486 4 года назад

    You are Amazing

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

    😢 I am getting error due to 11th and 12th line. Terminal saying no such file or directory

  • @caldanmeshach401
    @caldanmeshach401 4 года назад +1

    What is the algorithm for this?

    • @aipython
      @aipython  4 года назад

      This is based upon RESTAPI

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

    Osm

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

    How do I get the date and time for the timezone of the city we are searching for?

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

      You can't get the time and date by using the OpenWeatherMap API.
      To get time and date for a specific timezone you gotta use two additional libraries called pytz and datetime.
      To specify the timezone you are looking for, do:
      tz = pytz.timezone('Europe/Berlin')
      berlin_now = datetime.now(tz)
      the string called "tz" specifies the timezone you are looking for.
      the string called "berlin_now" get's the information by using the "tz" string above.
      Now you just have to do >>> print(berlin_now)

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

      Superb, well explained. Thank you so much HolyCow ,🙏

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

    Where to run the code sir can u explain

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

      You can execute code in any IDE of your choice preferably VS Code.

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

    I m getting keyerror in main temp

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

      Can you share the code and the error screenshot to aipython.india@gmail.com

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

    Hi... I keep getting this error and I have no clue why. Could anybody help?
    Traceback (most recent call last):
    File "c:\Users\*****\OneDrive\Documents\lol.py", line 26, in
    user_api = os.environ['current_weather_data']
    File "C:\Program Files\Python310\lib\os.py", line 679, in __getitem__
    raise KeyError(key) from None
    KeyError: 'current_weather_data'
    Thanks

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

      Hello, It seems like you have not created any variable having a name as 'current_weather_data' in the environment variable. Please make sure to create this variable and paste the api key in the value field of the same environment variable.

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

      You can refer to this video - ruclips.net/video/bcYKKX3ljlE/видео.html , for creating environment variable and assign a value to it

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

      @@aipython tysm

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

    is there any PPT related to this project if available then please provide the link

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

      Sorry, we don't have any PPT :(

  • @vildaalita4878
    @vildaalita4878 4 года назад

    Sorry im beginner in python, how ur spyder move to python374? And how to run the command? Please help

    • @vildaalita4878
      @vildaalita4878 4 года назад

      Sorry u use spyder or notepad++?

    • @aipython
      @aipython  4 года назад +1

      It is Notepad++

    • @vildaalita4878
      @vildaalita4878 4 года назад

      @@aipython but how to running the command to python?

    • @aipython
      @aipython  4 года назад

      I have explained in the video step by step. Do let us know , at what point you are getting issue.

    • @RahulKumar-px5jl
      @RahulKumar-px5jl 4 года назад +1

      Congrats

  • @sanjeevkumar-ub4sv
    @sanjeevkumar-ub4sv 3 года назад

    @AIPYTHON Sir I am getting error
    raise Key error(key) form None
    In line ** user_Api line ** even I have passed same name that I have of Api key

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

      Can you send the screenshot with code to aipython.india@gmail.com

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

    Bro iam getting keyError:'main'
    temp_city=((api_data['main']['temp'])
    How to resolve it

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

      same error in line number 13 please provide solution

  • @rainyvideo6936
    @rainyvideo6936 4 года назад +1

    where can i find the source code?

    • @aipython
      @aipython  4 года назад +3

      You can find the source code for all my project related videos at aipython. www.aipython.in/python/python-projects/

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

    sir plese help me ..i have an error...

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

      Have you shared your error screenshot to aipython.india@gmail.com

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

      @@aipython i have send screen sort..please chek your gmail sir.

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

      sir plese chek your mail..🙂

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

      @@tonightspecial7 Certainly, there is an issue with reading the information from the windows environment variable. YOu can watch this video for the solution of your problem ruclips.net/video/bcYKKX3ljlE/видео.html

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

    can you do this in kivy

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

      No idea about kivy.

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

    how to run the code at 10:16 ?

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

      You can use task scheduler or deploy it on Heroku cloud for free. Check my other video for detailed guide.

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

    I have user-api key error How to fix

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

      You need to create an account and generate user api key. Keep this api key in environment variables and use it in programming

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

    17:52
    my mind ......

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

    sir can u send coding file

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

    can you show the same method on linux?

  • @sauravvg1359
    @sauravvg1359 4 года назад +1

    Bro can you share all these codes as a file

    • @aipython
      @aipython  4 года назад

      Hi Sauravv,
      You can find the complete documentation as well as the code at our website www.aipython.in/python/python-projects/

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

    bro how can we save this data in .txt file using requests
    can u just tell me the code

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

      You can save the complete JSON response data in text or CSV file using file.write(filename.txt, 'w+')

  • @RADharani-yt8sx
    @RADharani-yt8sx 3 года назад +1

    Actually I want a weather forecasting project using spring framework will you please help me with that

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

      Hi Dharani,
      I can help you with python but no idea about spring.

  • @suryavamsichilukuri7475
    @suryavamsichilukuri7475 4 года назад +1

    Bro can u give that code plz

  • @Hail_Jesus
    @Hail_Jesus 2 месяца назад +1

    Jesus loves you so much brother. It’s not about religion but a relationship with the true and living God. He will give you so much peace and joy in your life. Ask him to reveal yourself to you in prayer and He will. If you confess with your mouth that Jesus Christ is Lord and believe in your heart that God raised Him from the dead you will be saved.

  • @siddu6825
    @siddu6825 7 месяцев назад

    Tq

  • @AnuTvme
    @AnuTvme 11 месяцев назад +1

    can you assist me for some time

    • @aipython
      @aipython  11 месяцев назад

      Hi,
      Share your contact details on aipython.india@gmail.com

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

    Sir I have sent you the pic of my error plz do check it out

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

      Sir did you get the solution for the error

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

      I will connect with you... Can you share your contact number via email

  • @zilizotufikia946
    @zilizotufikia946 4 года назад

    Response401

    • @aipython
      @aipython  4 года назад

      It's working normal, you can check again. Thanks

    • @zilizotufikia946
      @zilizotufikia946 4 года назад +1

      @@aipython yap it work, 👍

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

      Zilizo Tuikia can u help me