Google Sheets API Automation in Python

Ғылым және технология

In this video, we learn how to use the Google Sheets API to automate processes with Python.
Documentation: developers.google.com/sheets/...
◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
📚 Programming Books & Merch 📚
🐍 The Python Bible Book: www.neuralnine.com/books/
💻 The Algorithm Bible Book: www.neuralnine.com/books/
👕 Programming Merch: www.neuralnine.com/shop
🌐 Social Media & Contact 🌐
📱 Website: www.neuralnine.com/
📷 Instagram: / neuralnine
🐦 Twitter: / neuralnine
🤵 LinkedIn: / neuralnine
📁 GitHub: github.com/NeuralNine
🎙 Discord: / discord
🎵 Outro Music From: www.bensound.com/

Пікірлер: 84

  • @knalsgtes6684
    @knalsgtes668410 ай бұрын

    This is it! The tutorial that we've looking for. Very helpful for our new automation project. Looking forward for more automation tutorials. Done subscribe.

  • @mbeware
    @mbeware Жыл бұрын

    I was in the process of setting up an ETCD server for storing just a few shared variables. This would be perfect for our use case! Thanks!

  • @prof.code-dude2750
    @prof.code-dude2750 Жыл бұрын

    The best video for this topic! Loved it

  • @ukaszbudzynski9113
    @ukaszbudzynski91136 ай бұрын

    Great explanation! Very valuable, that You took us through the authentication and credential process...thanks!

  • @LlaneRost
    @LlaneRost Жыл бұрын

    Love watching you videos on my phone I always need my magnifying glass. Would love to see the text zoomed in a bit.

  • @valentinasinichenko751
    @valentinasinichenko7512 ай бұрын

    Amazing! Thank you for enabling me to get the job done so easily and getting me through all of the google api settings

  • @scottnorman2296
    @scottnorman2296 Жыл бұрын

    Excellent tutorial. Thank you!

  • @rublevv
    @rublevv6 ай бұрын

    Brilliant tutorial! Thank you, it was superhelpful.

  • @severtone263
    @severtone263 Жыл бұрын

    Great tutorial buddy. You earned a sub

  • @MZubair-ql4rn
    @MZubair-ql4rn4 ай бұрын

    Thank You dear,your typing speed is awosome

  • @soroushjamali492
    @soroushjamali492 Жыл бұрын

    Thanks, this is super helpful! How can we modify the code so that it gets triggered when there is a change in the sheet?

  • @davidtindell950
    @davidtindell9506 ай бұрын

    Great! Very Helpful !! Thank You Again !!!

  • @diegomgarcia00
    @diegomgarcia006 ай бұрын

    Great video! If I wanted to automate it even more, how can I trigger this code to run every time a new row gets added or a cell gets updated?

  • @omnitechsolutions1056
    @omnitechsolutions105626 күн бұрын

    Awesome video ! Complete explanation, This was the video i was searching for Thanks a ton bro :)

  • @bozok1903
    @bozok1903 Жыл бұрын

    I did my first app yesterday using google sheets and looking for a good tutorial to go further. Thank you for the video.

  • @susanca8443

    @susanca8443

    7 ай бұрын

    Congrats. Please can you describe what the app does?

  • @bozok1903

    @bozok1903

    7 ай бұрын

    @@susanca8443 It was an expance tracker. I used google sheets as a database.

  • @filltofill
    @filltofill7 ай бұрын

    After first excecution on my local machine, script can run on a sever/cloud under cron task for example? In other words: does the authorization process depends on the machine under the script is running?

  • @myvideos715
    @myvideos715 Жыл бұрын

    Thats what i was looking for ❤

  • @marchef7291
    @marchef72916 сағат бұрын

    the best video to learn google sheets api, Thanks!

  • @brany2920
    @brany2920 Жыл бұрын

    hi, i was using your example but got messed up wityh the security applied (oauth) . is there a way to use service instead???

  • @CaioMGA
    @CaioMGA8 ай бұрын

    Thank you so much for your tutorial

  • @akabaneaditya9469
    @akabaneaditya94698 ай бұрын

    thanks for your video, may i ask how to get the lattest row in gspead, 9i want to run log histrory from many devices

  • @DevOpsConsultantGuru
    @DevOpsConsultantGuru11 ай бұрын

    Bro you are great!!

  • @hizokadarkwolf
    @hizokadarkwolf Жыл бұрын

    Great introduction, it helped me a lot. Thanks. Q: Why not use a Service Account instead? If I manage to make it work, I will share the code as a reply to this comment.

  • @clmvdstap
    @clmvdstap5 ай бұрын

    Thanks a lot, usefull demo.

  • @user-rc7ix4rh5r
    @user-rc7ix4rh5r Жыл бұрын

    24:48 this part gives kind of satisfaction, like a magic

  • @siddharthkshirsagar2545
    @siddharthkshirsagar25456 ай бұрын

    Awesome video Thanks for this

  • @genelkanininaksine
    @genelkanininaksine Жыл бұрын

    Great tutorial.

  • @user-rc7ix4rh5r
    @user-rc7ix4rh5r Жыл бұрын

    I got json decoder error. Then, I checked the token.json file was empty after first authintication. I deleted token.json, then retried. it worked. Thank you brother, you really helped

  • @MrBossclub
    @MrBossclub Жыл бұрын

    Does the cloud service sheet api cost anything?

  • @linusheterlinus
    @linusheterlinus Жыл бұрын

    At 6:43 when he is storing the file. I don't get the option to store it as a Json File. For me it autosaves as HTML / text document. Please can someone help me out? Thanks!

  • @nadernofal7087
    @nadernofal7087 Жыл бұрын

    thank you alot man!!

  • @user-fj5hv8fp3h
    @user-fj5hv8fp3h Жыл бұрын

    Hey NeuralNine, do you have a video on the Keyboard shortcuts you use while developing in pyCharm? Some of these look really useful!

  • @kiwiwelch3620

    @kiwiwelch3620

    Жыл бұрын

    Only psychos use Pycharm

  • @ifigetbannedagainyoutubeis2018

    @ifigetbannedagainyoutubeis2018

    11 ай бұрын

    ​@@kiwiwelch3620nah pycharm is the best

  • @talhatasova1296
    @talhatasova1296 Жыл бұрын

    Would it be easier with the library called pygsheets? As far as I know, that whole authentication process and data manipulation operations take less amount of code and time. Is there any disadvantages of it? Great video btw, recently discovered the channel as an intermediate python developer, been improving already ^^

  • @completelybear

    @completelybear

    Жыл бұрын

    Pygsheets and/or gspread worked for me. Can manipulate the chosen cells as a pandas dataframe which makes it really handy!

  • @user-ft5hd7td6y
    @user-ft5hd7td6y5 ай бұрын

    Thank you so much!

  • @abdullahburakgun7112
    @abdullahburakgun711210 ай бұрын

    Is it possible to refresh pivot table from python code ?

  • @ogarjosephodama1878
    @ogarjosephodama187811 ай бұрын

    I think you should use real life case like inventory management system sheet

  • @susanca8443
    @susanca84437 ай бұрын

    Any reason you didn't use gspread? I use it and you install only that. The entire code one just three lines to authenticate and get the data.

  • @VishnuVardhan-Developer
    @VishnuVardhan-Developer10 ай бұрын

    When I try to run the first code which displays, all the data in the excel; a error occurs saying 'HttpRequest' object has no attribute 'get'

  • @findsarfaraz
    @findsarfaraz Жыл бұрын

    do you have to pay ? I am really afraid of using Google Cloud

  • @aleksalukic1904
    @aleksalukic1904 Жыл бұрын

    after i run the script google said : error : 400 redirect_uri_mismatch google

  • @facundolubo
    @facundolubo Жыл бұрын

    I have an error at 18:50: "No se puede acceder a este sitio webLa página localhost ha rechazado la conexión. Prueba a: Comprobar la conexión Comprobar el proxy y el cortafuegos ERR_CONNECTION_REFUSED"

  • @vladvol855
    @vladvol855 Жыл бұрын

    It is so complicated to set this configuration! Much easier to work via Excel, than this spreadsheets

  • @mehdismaeili3743
    @mehdismaeili3743 Жыл бұрын

    excellent.

  • @soufianesoufiane7218
    @soufianesoufiane72185 ай бұрын

    Yes, more about Flask

  • @levtroshchinskiy613
    @levtroshchinskiy613 Жыл бұрын

    Does anybody know why googleapiclient does not install in Pycharm?

  • @javiermorales5884
    @javiermorales588410 ай бұрын

    Background: So I have two gmail accounts. For some reason with one of the email I am not able to create a projects, this being a university email. I created my project with a personal email and wrote a script resembling yours. the sheet is created by university email so the personal one does not have access. Question: At what point in your code does it tell which google account is running the code? or does the project creator always need access to the google file even if its another user? or is it that since i ran the code and when asked for the account, such as you were when you first ran it, I selected the account without access?

  • @javiermorales5884

    @javiermorales5884

    10 ай бұрын

    just run the else: ----------- with () the two parts before the try

  • @mikkodarobloxian6316
    @mikkodarobloxian6316 Жыл бұрын

    awesome

  • @Patronesofly
    @Patronesofly4 ай бұрын

    how can we all all the data and put it in pandas?

  • @bisyrim1030
    @bisyrim10307 ай бұрын

    Hello friend, I think your content is excellent. but, can you make another example of storing data into a G sheet from a list or etc.

  • @amardeepyadav9511
    @amardeepyadav95112 ай бұрын

    Hey, man you seems the most intelligent guys among the youtube community.

  • @aroobae456
    @aroobae4566 ай бұрын

    I am gettint the error message: 400 redirect_uri_mismatch :(

  • @kylewilliams4721
    @kylewilliams47218 ай бұрын

    Where's the code in your github? There's a bunch

  • @tcgvsocg1458
    @tcgvsocg1458 Жыл бұрын

    good video

  • @sizemccuse212
    @sizemccuse21211 ай бұрын

    Hello great video, though I followed all the steps and when I try to write to the sheet it gives me an error saying ‘ACCESS_TOKEN_SCOPE_INSUFFICIENT’

  • @paololigori

    @paololigori

    6 ай бұрын

    did you solve this man?

  • @150nitrodude
    @150nitrodude6 ай бұрын

    Great tutorial, but I must say, it would be WAY easier to do this natively in Google Apps Script. The merits I see of using python would be to package the code into a Cloud function or something similar, but even then - juice might not be worth the squeeze. For those saying, "I only know Python", Apps Script is a slightly easier version of JS, so it wouldn't be hard for y'all to do what you need to do.

  • @grigorii_matiushkov
    @grigorii_matiushkov10 ай бұрын

    Hello, the following error appears: FileNotFoundError: [Errno 2] No such file or directory: 'credentials.json'. Although the credentials file.json is in the python project folder. Help please

  • @Idk-mk9cg

    @Idk-mk9cg

    10 ай бұрын

    Same problem, have you found the solution?

  • @user-xr4th2mw9y

    @user-xr4th2mw9y

    9 ай бұрын

    same thing have you found solution?@@Idk-mk9cg

  • @halasyamv3190

    @halasyamv3190

    6 ай бұрын

    @@Idk-mk9cg the solution is you need to name that json file he downloads in the beginining credentials and then save it in the directory that you are working in

  • @sowdah

    @sowdah

    5 ай бұрын

    SPECIFY ABSOLUTE PATH. If anyone else has this error, replace the "credentials.json" with its absolute file path. E.g. line 22 could mention "d:\CODEFOLDER\SHEETSPROJECT\credentials.json" instead of just "credentials.json"

  • @sowdah
    @sowdah5 ай бұрын

    If you get 'FileNotFoundError', try to specify an absolute path. Replace the "credentials.json" with its absolute file path. E.g. line 22 could mention "d:\CODEFOLDER\SHEETSPROJECT\credentials.json" instead of just "credentials.json" Tags : Errno 2. FileNotFoundError . No such file or directory . Folder . Can't Cant Find . Traceback . Same .

  • @fusebox9725
    @fusebox97254 ай бұрын

    I'm getting a developer permission error..

  • @wtfdoiputhere
    @wtfdoiputhere4 ай бұрын

    Tbh google app script is much better and more straightforward bcz that's basically its main function, to automate

  • @noyou9349
    @noyou9349 Жыл бұрын

    I'm getting an error : 'Credentials' has no attribute 'from_authorized_user_file'

  • @jorgeduardo101

    @jorgeduardo101

    Жыл бұрын

    use the following: "from google.oauth2.credentials import Credentials" instead of the line used in the video and it should work

  • @neilorourke814

    @neilorourke814

    2 ай бұрын

    @@jorgeduardo101 holy crap thankyou

  • @SuperN1
    @SuperN12 ай бұрын

    👍

  • @newbieprogrammer-qs3bq
    @newbieprogrammer-qs3bq5 ай бұрын

    i keep getting Traceback (most recent call last): File "e:\google sheets project\project.py", line 47, in main() File "e:\google sheets project\project.py", line 41, in main values = result.get("values", []) ^^^^^^ NameError: name 'result' is not defined

  • @babywaffles
    @babywaffles Жыл бұрын

    Doesn't work...

  • @user-nb2wj5mq2m
    @user-nb2wj5mq2m8 ай бұрын

    хороший , молодец, www забыл

  • @pawelp531
    @pawelp5319 ай бұрын

    I am getting "TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond" when it executes the "result = sheets.values().get(spreadsheetId=SPREADSHEET_ID..." line with firewall off.

  • @cassiuslives4807
    @cassiuslives4807 Жыл бұрын

    18:58 googleapiclient.http.HttpRequest no longer has a method called "get", so the line *values = result.get("values",[]) fails

  • @muneebbolo
    @muneebboloАй бұрын

    getting this error: Traceback (most recent call last): File "C:\Users\PC\Downloads\GoogleSheets_Project\connect_to_sheets.py.txt", line 45, in main() File "C:\Users\PC\Downloads\GoogleSheets_Project\connect_to_sheets.py.txt", line 23, in main flow = InstalledAppFlow.from_client_secrets_file("credentials.json", SCOPES) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\PC\AppData\Roaming\Python\Python312\site-packages\google_auth_oauthlib\flow.py", line 198, in from_client_secrets_file with open(client_secrets_file, "r") as json_file: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FileNotFoundError: [Errno 2] No such file or directory: 'credentials.json' [Finished in 1.9s]

  • @ogarjosephodama1878
    @ogarjosephodama187811 ай бұрын

    I think you should use real life case like inventory management system sheet

Келесі