Google Sheets - Python API, Read & Write Data

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

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

  • @par-medrealtyofficial4296
    @par-medrealtyofficial4296 Месяц назад

    Love this guy's personalty and teaching style.

  • @unknownentity330
    @unknownentity330 3 года назад +8

    You are an absolute gent. Experimenting with Google APIs was daunting until being guided so eloquently. Thanks so much

  • @shellbot972
    @shellbot972 2 года назад +17

    0:00 : Intro
    1:53 : Dependancy Installation
    3:45 : Authentication
    15:25: Reading Data
    19:54: Writing Data

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

      03:26 Authentication | Create a developer console
      04:27 Authentication | Activate Google Sheets API
      04:57 Authentication | Create service account
      06:21 Authentication | Create service account
      07:21 Authentication | Create service account | Create key
      09:15 Authentication | Connect service account
      11:46 Authentication | Access sheet
      12:41 Reading Data

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

    I cannot stress it enough how amazing this video is. You explain everything so well and with so much detail. All Google APIs have been making me go crazy and i never managed to use one, until this video! Just amazing work!

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

    I have been struggling with Google APIs for days. Your explanation is so clear and easy to understand. Can't thank you enough.

  • @jamesvandermost3802
    @jamesvandermost3802 2 года назад +9

    I cannot tell you how great this video is. Literally so much easier to follow than googles documentation. Thank you so much.

  • @salterrific
    @salterrific 4 года назад +33

    Please continue making these videos. I've tried learning apps script and the APIs on my own and it was very difficult without seeing examples. I don't have a computer science degree, but I do a fair amount of coding for my job and these tutorials have helped tremendously.

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

      Agreed. Google's documentation is extremely painful for a beginner. I would no have known that so much of the quickstart.py is useless for a basic get/update script.

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

      you all probably dont care at all but does someone know a trick to log back into an instagram account?
      I somehow forgot the account password. I love any help you can offer me!

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

      I've found just messing around and trying to build basic things first as i read through the documentation helps me a lot

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

    Really appreciate for creating this video. Was following the Google API docs and went into error loops. Following exactly what you mentioned worked. Thanks a ton. Cheers!

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

    This video is invaluable, this is much harder than I imagined.

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

    You rock! The Google docs are a mess and your video is insanely clear in comparison. I lost half a day battling with the Google documentation but thankfully you appeared.

  • @RodrigoLobatorodrigo
    @RodrigoLobatorodrigo 3 года назад +9

    Simply Awesome! I was struggling with google's API instructions and your tutorial made it look sooooo much easier. Thanks a bunch! It really helped me :)

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

    A really good explanation for the useless documentation!

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

    thank you SO much!! i have a deadline next week and this was an essential part of my code. you saved my grade :)

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

    Excellent explanation. Am using the google sheet APIs for the first time and this saved a ton of time. Thanks!

  • @JbotMischief
    @JbotMischief 3 года назад +5

    I really like the way you present information, you make concepts accessible to people who may not have a formal technical background. Keep it up, I've learned several genuinely useful techniques/methods from you that I put to use in my work.

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

    Awesome video! I like how you just cut to the chase.

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

    Thanks a lot for making this video. Explains how to access google sheets so much better than the google documentation.

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

    WOW. Thank you, you just introduced me to a whole new world. Great explanation and loved the fact that you didn't cut the video so we could see your reasoning and debugging

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

    Man i'm not gonna lie you earned your sub from my part. A very nice tutorial i'd absolutely recommend if someone asked me hw to use gsheets and py. Nicely done m8

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

    thank you so much for this video. it was straightforward to follow and made a lot more sense than reading through the documentation

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

    This is really a great level of explanation.

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

    It works pretty well !
    I had to install "pip google-api-client" before to run the program

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

    This is so straight, clear and very helpful!

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

    Best tutorial about read and write out there

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

    My problem was making an API -> json. You explenaed it very good and understandeble for the Dutch people. Many thanks for the lessen also with the Python script 👍👍

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

    only clear tutorial i've seen! Thank you so much!

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

    Thanx man i was working with chatgpt for this matter it didn't work until i watched your video and understood some details thank you so much

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

    NIce video.. one query - If I use google colab to create script then where to save secret_key.json and how to change our code as I am getting error 'ValueError: Authorized user info was not in the expected format, missing fields client_secret, refresh_token.

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

    Man, this is still work, thank you bro.

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

    Thanks ... you demystified the approach for me!

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

    the best tutorial I've ever seen

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

    Thank you, this saved much of my time and efforts to simply read from gsheet.

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

    great tutorial. highly appreciated. being a novice it took ages to understand it and also tect the code. requesting a follow on tutorial for updating live stock market date on google sheets using python. will be highly appreciated.

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

    Thanks... that`s the best tutorial I have found...

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

    Perfect ! Thanks for your effort and clear presentation

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

    Thank you so much, your videos are simply the best out there. Thank you

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

    My friend, you're the best! thanks

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

    Thank you for this useful manual, it hepls me a lot!

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

    Great tutorial. Extremely clear.

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

    Thanks! I can finally create my own stat tracker with this!

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

    This is a gold mine man, thanks!

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

    Thank you for explaining it so good. You should continue publishing your easy way of explaining more often.

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

    Very great walkthrough, you also show a bit how you do the digging in the docks. Thank you very much. Gracias Muchas.

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

    You rock! Was trying to figure this out for a while but this made it very simple :)

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

    Спасибо, брат! Ты лучший!

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

    Thank you for all the tutorials. I have learnt alot from the Google sheets and App Script. I realized that there is much more for me to learn. And endless..

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

    Thank you soo much you are soo brilliant! Most concise, clear, easy to follow, well explained tutorial out there! Can't thank you enough

  • @chrisder1814
    @chrisder1814 12 дней назад

    Hello, could you help me understand how I could synchronize my Google sheet products catalog with multiple marketplace, I was thinking about APIs?

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

    Thanks for making this. It actually works!

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

    Hello! I have a question regarding the accounts to interact with the API. How could I create accounts for users who are going to access the spreadsheet to save or read information?

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

    Very helpful for my project!, thank you mate!

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

    finally did it. thank you for this video. explain everything perfectly.

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

    You are amazing, you helped me very much.

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

    hello! i have a problem where my service.spreadsheet() where it says "Instance of 'Resource' has no 'spreadsheets'" can you help me?

  • @pipeliner8969
    @pipeliner8969 4 года назад +10

    This is gold, thank you!

  • @KC-hl4oj
    @KC-hl4oj 2 года назад

    Thanks for this video - very easy to follow and understand 👍

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

    Wow you explained everything beautifully thank you so much

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

    Can we not write to sheets by authenticating API with API key only? Service account creation or oautj is mandatory to update sheets?

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

    Hey, what changes to be made if access is to be requested as well to read the spreadsheet?

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

    Nice 👍 👍👍

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

    For get, is there a way to get the values with just the starting point or do you always need to have both?

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

      I think if you skip the argument it gives you the whole worksheet, otherwise you need the specify the range.

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

    Hello, excellent video. Thank you. One queston, do you think this will work on microython?

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

      Very likely. Just run pip install and if you don't get any errors then you should be fine.

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

    It was a great help. Thank you.

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

    Man you're awesome x). Exactly what i needed ! Thanks a lot and keep inspiring people !

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

    Hello, I was wondering how you would format cells. Such as background color, text size, text color, merging cells ect.

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

    Thank you soo much
    Amazing video
    Works perfectly !!!!!

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

    may I ask why your method do not need any token.pickle? I haven't use my token for a while and then it is not valid and cause refresh error. I tried but cannot generate new token, always get error

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

    This is a very good example, thank you!!

  • @ΣυμεώνΠαπαδόπουλος-λ4ο

    Thank you for your great tutorials, I can't express my gratitude for the knowledge you provide us for free. Because I don't know about APIS and python I had a problem when I tried to install pip. The message was: pip3 : The term 'pip3' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was inclu
    ded, verify that the path is correct and try again. I would be grateful to anyone who can help. Thank you!

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

    Amazing explanation!

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

    hi Thanks for the videos,
    how can write more than one value in same spread sheet?

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

    what would be a good way to privatize the json file?

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

    Really nice tutorial. Thanks a lot for explaining it

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

    Thank you! I'm trying now to connect to slides with the spreadsheet data and write to slides from within a single project. Seems like i will have 2 scopes and 2 services and 2 keys? But there's no where I can find that clearly shows how those connect in a single project. I send examples of 2 scopes, and I've tried creating the 2 services just like you've created the one for spreadsheet. But I don't see how to manage the 2 separate keys and I'm getting token errors. Thanks for any advice , example out there in the universe...:)

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

      One key should work for both services so long as you setup authorizations scopes correctly.

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

    Another great video. Thank you!

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

    is there a way to extract URL from the text in a cell with this method?

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

    where did that spreadsheet come from?

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

    Excellent example, just what I needed. Thanks.

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

    Thank you very much for this!

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

    Is it possible to read from google sheet and write to excel, and vice-versa?

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

    Hello Mr, thanks for your video, it was very helpful! Is there a way to get the data in JSON format instead of list of lists? Thanks

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

      Not sure what you mean by JSON format since this is not JavaScript.

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

      you could use a dict comprehension to create a python dict since it has a identical structure to json object

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

    Very nice tutorial! How would you read a local spreadsheet and then write that to the google sheet (then it would be run on a schedule to keep the Google sheet updated)?

    • @OmerOmer-xg9kl
      @OmerOmer-xg9kl 3 года назад

      looking for something similar

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

      you could use pandas (a python package) to read the xlsx/csv from local, transform it into a dataframe, make the necessary transformations and then send it to google sheets using his method :D

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

    Thanks for making this, I have a problem with while reading the data(can able to read the data, but the data is not formated) from google spread sheet
    Sample data
    1;03.05.2022 00:12:14;1,04992;1,05079;
    Column separator is ;
    but the problem is data's are reading in different format,
    existing output:
    1;03.05.2022 00:12:14;1, 04992;1, 05079;
    expected output
    1 03.05.2022 00:12:14 1,04992 1,05079

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

    Thank you so much! I have spent a while trying to learn this api and you made it incredibly easy and well explained! +1 sub :))

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

    Sir, how to get success or failure message after submit data to sheet?

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

    Thank you for, by this thing first I scraped a news site then exported all the news headlines and links in my google sheet, thank a lot...

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

    Do you have a video showing the create API?
    My create API question. I've taken this example and trying service.spreadsheets().create to work using a service account. My request returns a sheet json doc with ID, I can't open it (I get the browser authorization request blocker) and the sheet doesn't show up in my personal drive.
    1. Does create API work with a service account?
    2. When created, where does it goes?
    3. Can I create a sheet inside a pre-existing folder?
    Hope you answer, thanks for this video. My read&write python code worked without issue.

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

      If you're in gsuite, you should be able to grant domain wide access to service account from API console. Otherwise, it's probably best to use Google Drive API instead to create the file and then you can write to the file with sheets API.

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

      @@ExcelGoogleSheets Thanks, I'll try that tomorrow.

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

      @@ExcelGoogleSheets I used the Drive API to list the service account drive files. The listing shows all the files that I created with sheets.create method. They are there, so sheets.create functions correctly. However, these service account files are not part of my personal google account drive files. They are not shown when I use my browser to see my Drive files. How do I use a browser to see these service account files?

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

      OK, I figured it out. service account sheets.create works correctly. The method creates a sheet in the service account's drive not my personal account's drive. In my personal account's drive, I share a folder with the service account, then using the Drive API have the service account move the sheet it created from its drive to my personal account's shared drive folder. Hope that makes sense. See this page, developers.google.com/drive/api/v3/folder#moving_files_between_folders Thanks for your help.

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

      @@CraigHollabaugh I guess the only drawback is that "the owner" of the file will be the service account.

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

    Many thanks ,ur video made my day

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

    Nice Video Sir please make more content how to use the other methods like clear, append using node.js

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

    This is Excellent, but i need help with once the document uploaded or updated, how to save commit message (version control) ??
    Please help with python script or programming

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

    It helped me a lot!
    Thanks for the such a wonderful content.

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

    sous un genio amigo me re ayudo tu tutorial

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

    Very nice tutorial, easy and simple to follow, great job. Still not getting over "PieTon" though.

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

      So what's the correct way?

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

      @@ExcelGoogleSheets Because the google cloud security setting up is rather complicated, the easy way to get set up i to watch a YT clip like your brilliant one here to get you over the tough bits. It helped a lot. I just had to giggle a lot, in English language, the 'h' is sometimes silent (not pronounced) but in python, it's not, it's a "th" sound, as in "thick". So the world is pronounced like "pie"-"thonn" , because you linger on the "n" a bit. Do keep sharing more of these tech explainer videos, great presentation skills!

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

    Great explanation. Thank you.

  • @harshal.rathore
    @harshal.rathore 3 года назад

    yeah they do change their UI like crazy fast. difference between a same video 1 year ago and this one is huge.

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

    AWESOME!! Loved IT

  • @8ksmiff502
    @8ksmiff502 3 года назад

    Hello Sir! I have parse data with my python file and getting the result in python console, now I want to export this data to google sheet. Can you help me to do that ?

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

    Absolute legend, thank you!

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

    Excellent video, thank you so much!

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

    Hai sir, ur video super. I learn so much ur channel. I have one doubt I'm using excel data python. Excel sheet cells I have created formula. Excel read data python program only copy formula not value. Please help me I need excel rows read values only. Please advise sir.