Well, googling about all technical stuff didn't bring a solution. However, a 15 min. video contains more info than the Google developer site itself. Well done.
@prettyprinted6 жыл бұрын
I'm glad the video helped! Thanks for watching.
@stillinmusic6 жыл бұрын
Same here. Banging my head against the wall when reading Google developer site
@stillinmusic6 жыл бұрын
I was banging my head against the wall when reading google developer site. Thank you so much for saving my head.
@d4lep0ro6 жыл бұрын
Dude, thank you very much. I was struggling with the incomplete documentation from google and after hours I find a brilliant 15 min solution.
@prettyprinted6 жыл бұрын
Glad it helped. Thanks for watching.
@TheTeachinggeek5 жыл бұрын
Thank you so much! I am a teacher using python in my classroom. Not an expert by any means, but what a boon this skill is now. I have watched a few videos on the topic , but your video gave me the 'aha!' Thank you thank you thank you!
@prettyprinted5 жыл бұрын
I'm glad you like my videos! Thanks for watching
@hfrnd-hu2kz6 жыл бұрын
Dude, you are awesome. Clear and concise, can't ask for anything more.
@prettyprinted6 жыл бұрын
Thanks for watching!
@devve74 жыл бұрын
Excellent explanation, clear, direct, complete. Congratulations, good work !! Regards.
@SilvianDragan4 жыл бұрын
This is a fantastic video. Literally the template I go to when I need to get started on gsheets manipulation using python.
@kenocontreras6 жыл бұрын
First of all, thank you for your video. Guys, if some of you get an error about "invalid_scope: Empty or missing scope not allowed" I fixed doing this: credentials = ServiceAccountCredentials.from_json_keyfile_name('secret_credentials.json') scope = ['spreadsheets.google.com/feeds', 'www.googleapis.com/auth/drive'] credentials = credentials.create_scoped(scope) gc = gspread.authorize(credentials)
@quaternion-pi6 жыл бұрын
Excellent! Looking forward to additional videos on using Python with Google Sheets.
@prettyprinted6 жыл бұрын
Thanks for watching!
@eliz40576 жыл бұрын
Thanks sooooooo much! I googled around and read so many documents that didn't really help. Your video is exactly what I need!
@prettyprinted6 жыл бұрын
I'm glad it helped. Thanks for watching.
@larsjohansson12056 жыл бұрын
I do not know python, I just followed the video and it worked, easy peasy. Good tutorial.
@prettyprinted6 жыл бұрын
Glad the video helped. Thanks for watching.
@isaaccoltrain52705 жыл бұрын
This was a fantastic tutorial. Please keep making great content like this. Looking forward to checkout out the rest of your channel.
@yuvigerstein5 жыл бұрын
I'm kind of new to python and to Google APIs, and your tutorial actually worked for me. Awesome work! thank you sir!
@prettyprinted5 жыл бұрын
Glad I could help. Thanks for watching!
@AestheticVodka6 жыл бұрын
Excellent tutorial, still relevant and super helpful several months down the line, all the best!
@prettyprinted6 жыл бұрын
Thanks for watching!
@auralearningcenterllc55036 жыл бұрын
Very well explained. Excellent Video
@prettyprinted5 жыл бұрын
Glad you think so. Thanks for watching!
@UkiDLucas6 жыл бұрын
Thank you, I was missing the copy the email and share my own spreadsheet part till now!
@yendys745 жыл бұрын
cant thank you enough , this super helpful
@prettyprinted5 жыл бұрын
you're welcome! I'm glad I could help.
@Virusosm5 жыл бұрын
At 4:02 What is the thing you pulled up?
@prettyprinted5 жыл бұрын
A terminal for Ubuntu on Windows.
@altafnavalur5 жыл бұрын
Excellent! Thank you so much
@prettyprinted5 жыл бұрын
You're welcome! Thanks for watching.
@brunosantos36726 жыл бұрын
I liked, you teach well. Waiting the next.
@prettyprinted6 жыл бұрын
Thanks for watching.
@ArielYLuo6 жыл бұрын
This is a life saver, thank you!!
@prettyprinted6 жыл бұрын
Glad it helped!
@SolidBuildersInc5 жыл бұрын
Awesome solution. This may be the issue with some other problems I am having with Google Credentials that have been deprecated. Are you still going to provide some examples of this gspread library and the popular Query() Function? This is got me on the edge of my seat.
@SolidBuildersInc5 жыл бұрын
I found it, sorry - kzbin.info/www/bejne/r4G0Y3qhaJiVZ7c
@sharvilpopli41196 жыл бұрын
very precise, thanks! using gspread for raspberry pi data logging
@prettyprinted6 жыл бұрын
You're welcome! Thanks for watching.
@jaypod6 жыл бұрын
That's awesome. Thank you so much! It worked. I'm trying to figure out the Google APIs though. Hopefully I'll be able to figure out how to use them instead of the gspread library.
@prettyprinted6 жыл бұрын
I'll probably cover the Google API in the future if they don't keep changing their APIs.
@brandoncavinee46306 жыл бұрын
Great! Thanks for posting
@prettyprinted6 жыл бұрын
You're welcome. Thanks for watching.
6 жыл бұрын
Nice and handy video. Waint8ng for new lessons
@prettyprinted6 жыл бұрын
Thanks for watching.
@s_p_a_c_e_m_a_n5 жыл бұрын
Awesome video, been trying to figure this out via Goolgle QuickStart and failed, your fixed that! THANK YOU!
@supergogeta2833 жыл бұрын
hello, thank you so much great tutorial! I was wondering if I make a single route flask app to update a google sheet, I want the update to append just by pinging that route, can I do that?
@jhicinternational6 жыл бұрын
Many thanks, God bless you!
@prettyprinted6 жыл бұрын
Thanks for watching!
@LaureanoPiotti96 жыл бұрын
Amazing! Thank you very much =)
@prettyprinted6 жыл бұрын
You're welcome! Thanks for watching.
@AntonFrolov16 жыл бұрын
Like a boss, sire. Thank you!
@mohdhasanrizvi69405 жыл бұрын
you saved us. Thanks
@prettyprinted5 жыл бұрын
Glad I could help.
@slinbody6 жыл бұрын
Good Tutorial!
@prettyprinted6 жыл бұрын
Thanks!
@bowzer0875 жыл бұрын
Do you ever have the error FileNotFoundError: [Errno 2] No such file or directory: 'client_secret.json'? I've followed along to your video but can't get around this error.
@RomuloMagalhaesAutoTOPO6 жыл бұрын
Anthony, congratulations! Very simple and clear explanation. But, how I mention before: Do you could use low resolution to record yours video? This will facilite visualization on mobile and tablet. Thank you!
@prettyprinted6 жыл бұрын
It's a tradeoff between videos for desktops and videos for mobile when it comes to code. I prefer desktop because most people will write code along with the videos.
@uppiupenderreddy5 жыл бұрын
Good info, Thank you, how do I create another sheet2 in same doc? Thanks
@prettyprinted5 жыл бұрын
sh.add_worksheet(title="A worksheet", rows="100", cols="20") Here are the docs: github.com/burnash/gspread
@lamissdesdourmettes6 жыл бұрын
Hello thank you very much for your help! Do you know how to add a formul in a cell and not a string, like add : =A2+B4?
@prettyprinted6 жыл бұрын
Try using value_render_option='FORMULA'. Like this: gspread.readthedocs.io/en/latest/user-guide.html#getting-a-cell-value
@johnson99093 жыл бұрын
I the example.py file the same as manage.py file? I am trying to figure out what file the example.py file is representing and is it meant to be a independent file or is the code supposed to be added to manage.py?
@affankhalid31156 жыл бұрын
Thank you for this useful video. I have one question. can I access other sheets which has been created with different google account and share with the Email address I have receive in credential file? if so, can you tell me how?
@gnanke6 жыл бұрын
You should be able to just add the service account email to the spreadsheet sharing tab that you want to share, then (using the naming convention used in this video) just setup another wks_other var with the new table name in gc.open('')
@xavier_yang6 жыл бұрын
Nice video!
@prettyprinted6 жыл бұрын
Thanks for watching.
@monlewi19766 жыл бұрын
Cool video. What do you think about overall performance to use google sheets as database for some simple project... even it's easy then include some logics inside google sheets (functions in cells) to achieve more backend functionality, kind of functions i.e. in postgresql. Sounds crazy?
@prettyprinted6 жыл бұрын
Using Google Sheets instead of a database is a good idea if your data is simple enough to be handled by Google Sheets. Can save a lot of time and make it easy for non-programmers to modify your data.
@monlewi19766 жыл бұрын
Pretty Printed thanks for reply bro
@lukaslindblom6 жыл бұрын
Great helped a lot! Is there a command for adding all your data at once (not row by row). It seems to take a while...
@prettyprinted6 жыл бұрын
You can use update_cells to handle more than one cell at a time. Check out the API docs: gspread.readthedocs.io/en/latest/
@jsonr5 жыл бұрын
Hey, great video! Is there a way that I can have it so it runs over and over, because I hear the key expires again after 1 hour. I need to create a refresh key and save it, but I don't know how, and all of the solutions on the docs use google's system, and I don't know all of the information for it.
@pulsepledgelife6 жыл бұрын
thank you!
@prettyprinted6 жыл бұрын
You're welcome!
@SuperMaax226 жыл бұрын
Hi men, how about the concurrent editing of a cell, is there some kind of tool to disable it ?
@arjunkirpal97766 жыл бұрын
One word: Awesome
@prettyprinted6 жыл бұрын
Thanks for watching!
@CaptainAdd495 жыл бұрын
How do you get the gspread libraries? When I type that command into cmd or python I get errors.
@kyleyoung49744 жыл бұрын
One thing to add: the file that google provides must be located within the python project folder for this code to work. Most of you probably knew this but...
@mattg52625 жыл бұрын
Can you please make something similar for Google Calendar? Awesome video by the way!
@prettyprinted5 жыл бұрын
I'll consider making one on Google Calendar. Thanks for the idea.
@mattg52625 жыл бұрын
@@prettyprinted Please do!!! There is literally no courses/tutorials how to use it with python !
@RachitKinger6 жыл бұрын
Question - By using this method, I need to add the client_email to the spreadsheet's share settings. Is there a way to get access to all of my drive files and explore them, select the one I need and read from it? By the way - thanks a ton for this tutorial. Was really useful.
@RachitKinger6 жыл бұрын
Sorry about replying to my own question. I figured out a way of doing this and have published a blog post today morning on it in case anyone here is interested - www.wackycoup.com/post/working-with-google-sheets-in-python-pandas-and-r/
@prettyprinted6 жыл бұрын
Thanks for creating the post and linking it here.
@tnebula21006 жыл бұрын
I'm having a problem installing gspread. I tried to install it with pip (pip install gspread), but then it outputted "-bash: pip: command not found" and when I tried to install pip (Unable to locate an executable at "/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/bin/apt" (-1)). Using OSX. Can I please have some help???
@johnn43146 жыл бұрын
Thanks decent. but what does installing the Oauth2 client and pyOpen SSL do?
@prettyprinted6 жыл бұрын
OAuth2 (and SSL by extension) allow you to connect to Google's API. It's the way they want you to authenticate.
@breannthiessen51585 жыл бұрын
I have got data going into my sheet1, however I am wondering how to get data into sheet2 in the same document? I tried just putting wks = gc.open('Test').sheet2 that did not work, do I have to make a separate credential? I have been googling solutions and cannot find anything. Thank you!
@dirkb8066 жыл бұрын
I assume one can do this setup also in a jupyter notebook? What about an example of automation via a cron hosted somewhere ?
@prettyprinted6 жыл бұрын
Yeah, this can be done in a notebook. I'll think about that example. Thanks for the idea.
@dirkb8066 жыл бұрын
Pretty Printed Yeah would be cool to also highlight some automation tools with python!
@Bleeinyourself6 жыл бұрын
Thank you so much for this. Question: if I want to hide the "client_secrets.json" file on github and want to use Heroku to hide it as a variable, which key from the JSON file can I pull out to store in place of the "credentials" variable in here: gspread.authorize(credentials)?
@prettyprinted6 жыл бұрын
I'm not completely sure since I haven't done something like that, but the most sensitive value in the json file is the private key.
@Bleeinyourself6 жыл бұрын
I think I found the solution. If you don't want to upload the client_secrets.json file on github for everyone to see, you can use a different oauth2client method called "_from_parsed_json_keyfile" which I found in the "\service_account. py". Simply create a variable (in Heroku you can go to config hidden vars to make a hidden variable), and copy/paste the dict-like contents of the "client_secrets.json" and set that as the variable: client_secret = { "type": "service_account", "project_id": ****** ...(rest of the contents of the .json } Then use the "_from_parsed_json_keyfile" method which takes the (dict-like string, scope) as arguments. In your script, set: credentials = ServiceAccountCredentials._from_parsed_json_keyfile(client_secret, scope). Now you shouldn't need to upload the client_secrets.json file publicly. It worked in my IDE and I'm gonna try it with github/heroku.
@prettyprinted6 жыл бұрын
Great! Thanks for sharing this approach.
@pulsepledgelife6 жыл бұрын
can I dm you with a question relating to this? working on a similar project, new to python I need the results of my script to dump into the spread sheet
@prettyprinted6 жыл бұрын
You can email me at anthony@prettyprinted.com
@pulsepledgelife6 жыл бұрын
Pretty Printed I actually ended up figuring it out, thanks for the reply back tho!
@samapriya16 жыл бұрын
How do you get the list of scopes? or the link to the scope urls?
@prettyprinted6 жыл бұрын
Google has a ton. They'll mention them in the API docs for the API you want to use.
@jamielunn58696 жыл бұрын
thanks! when i append a timestamp and a float, the cells in the google sheet are formatted as text. is there a way to append the actual date and float value?
@jamielunn58696 жыл бұрын
i got it: wks.append_row([timestamp,value],value_input_option='USER_ENTERED')
@prettyprinted6 жыл бұрын
Glad you figured it out. Thanks for watching!
@keshavdamani12735 жыл бұрын
will there be any problem if that mail of google sheets is not been notified via sheets , is it real mail address ?
@prettyprinted5 жыл бұрын
I'm not sure. Try it out and see if it works.
@ashwinkumarramaswamy93693 жыл бұрын
I don't have that download json option in my console
@LongPham-vg4lz6 жыл бұрын
Hi, I got this error while following your instruction: ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833). Can you help me ?
@prettyprinted6 жыл бұрын
It could be many things. I've had the same error before. I recommend doing a Google search for the error and trying out the solutions.
@LongPham-vg4lz6 жыл бұрын
I finally found a solution. But there's another problem. When I use: print(wks.get_all_records), I got this result:
@LongPham-vg4lz6 жыл бұрын
NVM: I found the mistake. Tks very much man !!!
@shirsendudhar89444 жыл бұрын
Is there I can make a graph in google sheet from python, and every time I edit the data, the graph auto adjusts accordingly .
@mr_jacklu80144 жыл бұрын
are you actually asking whether the new data inputted into google sheets via Python codes will automatically update the chart already in Google Sheets? if you have a chart in Google Sheets based on a table with all the columns highlighted and add new rows using Python then the chart should changed based on your edits.
@shirsendudhar89444 жыл бұрын
@@mr_jacklu8014, yes exactly. I have a dataset in gsheet. Every time I run the python program it is supposed to add a column to the dataset. This thing I want to display in gsheet.
@shubhamgoel2384 жыл бұрын
It is showing me error SpreadSheetnotfound. So what should i do now?
@gokulnathgm6 жыл бұрын
Thanks for the video. Could you please help me resolve this error? oauth2client.client.HttpAccessTokenRefreshError: invalid_scope: spreadsheets.google.com/feeds is not a valid audience string.
@sivaranjan8626 жыл бұрын
"", I keep getting this message, can someone help me out? Edit: i missed my parenthesis
@nickbissanti6 жыл бұрын
I got this too, did you ever figure this out?
@gabrielbacon85036 жыл бұрын
How do i get the python stuff
@mattg52625 жыл бұрын
You mean like Python in general?
@ivansim24576 жыл бұрын
is there a part 2 already?
@prettyprinted6 жыл бұрын
Yes: kzbin.info/www/bejne/r4G0Y3qhaJiVZ7c
@emokhan79276 жыл бұрын
what is the use or pyopenSSL in this project ? Do I have to do anything special to make SSL request.
@prettyprinted6 жыл бұрын
You need SSL to connect to the API. You don't need to do anything special if your computer is configured correctly. The code in the video should be enough.
@hjain6 жыл бұрын
Is there a way to clone and copy a worksheet from one spreadsheet to another?
@prettyprinted6 жыл бұрын
Look into the copy method: gspread.readthedocs.io/en/latest/api.html#gspread.Client.copy
@noobsauce89526 жыл бұрын
Thanks for an incredibly simple and straight forward tutorial, I wish I came here before wasting an hour googling and reading Google Developer docs. One question, do you know how to create a blank Spreadsheet via the gspread API? The gspread docs say this should work: gclient.create("test_this"). It seems to work in the python code (no assertions or errors raised) however nothing is actually created in my Google Sheets account.
@vivekchoudhary87456 жыл бұрын
you need to share it too. to make it visible.
@Anya_mjee6 жыл бұрын
This is very helpful! Is there a way I can write to subsequent sheets "sheet2, sheet3" and so on, when i try specifying 'sheet2', I get the error: wks = gc.open('ec2_tracker').sheet2 AttributeError: 'Spreadsheet' object has no attribute 'sheet2' Other resources online aren't very helpful. Thanks!
@d4lep0ro6 жыл бұрын
use get_worksheet(index=your_index_number)
@333JaydeeP5 жыл бұрын
@@d4lep0ro I am also stuck in this point...can you plz elaborate the solution
@yontenjamtsho15395 жыл бұрын
I get the error message on my Gmail account "Delivery Status Notification (Failure)". Can you give me a solution to fix it?
@blackmagic100006 жыл бұрын
Hello friend. Would it be possible to take a list of URLs from a single column and then scrape a single div of data on each URL and return the values back into the adjacent column? I was able to return a column of Bit.ly links and I am looking to grab the total click amounts. When you take a bit.ly link and append a + to it, it provides the dashboard, which is a whole lot easier than having to go through the login form and deal with the AJAX scroller. Thoughts?
@sourabhkumarsingh16966 жыл бұрын
i m new to this, can anyone tell me how i can copy & paste the jason file in the directory, i m using Windows 10 & python 3.6 and where i have to run the code of python so it can be run in googlesheet
@IronMan-kb8bl5 жыл бұрын
how to use search/find in this. eg Say if i gave i/o as 'somedata' it should give the value of neighboring i.e the o/p should be 'someotherdata'.
@MrMaxwell946 жыл бұрын
if anyone was getting an error: feeds is not a valid audience string go to: stackoverflow.com/questions/49829002/invalid-scope-https-spreadsheets-google-com-feeds-is-not-a-valid-audience-str the answer has the updated scope addresses which worked for me
@prettyprinted6 жыл бұрын
Thanks for this!
@ArchAid16 жыл бұрын
Hi :) Thanks for the great video. I have two questions: 1. How come this video is so different from Google's own documentation (here: developers.google.com/sheets/api/quickstart/python) I mean, your solution obviously works. So I'm just curious. 2. I'm having trouble getting the scope right :-/ Console says: oauth2client.client.HttpAccessTokenRefreshError: invalid_scope: spreadsheets.google.com/feedsgoogleapis.com/auth/drive is not a valid audience string. I've tried to .join() them, but to no avail. Any ideas? Thanks again :D
@prettyprinted6 жыл бұрын
The scopes should be two separate strings in a list. My example is different because it uses the helper library gspread. The tutorial you linked uses Google's own library.
@swist6665 жыл бұрын
There is also a solution called sheetdb.io - it is much easier to setup. You make a request to API and in response you get json data from spreadsheet.
@prettyprinted5 жыл бұрын
I'll check it out. Thanks.
@Jenny-ni3bg6 жыл бұрын
NICEEEEEEEEEE, LOVE U
@prettyprinted6 жыл бұрын
Thanks for watching.
@mekalabhagyadeepikadeepika5245 жыл бұрын
how to get credentials file using python code with email and password of gmail account
@archer_biotronica98365 жыл бұрын
when I share the google sheet file to the client_email: I get a message on my gmail stating that the email provided is invalid. anyone has a solution for this????
@fatmaabdelraouf11346 жыл бұрын
I got this error message "AttributeError: 'str' object has no attribute 'access_token"
@fatmaabdelraouf11346 жыл бұрын
I fixed it , thank you for you video it's awsome.
@prettyprinted6 жыл бұрын
You're welcome! Thanks for watching.
@Dudleyism16 жыл бұрын
why is the documentation so poor on googles sight or am I that bad ?
@prettyprinted6 жыл бұрын
Google generally makes bad documentation. I guess they know they can get away with it.
@travismiller68186 жыл бұрын
I am getting the following error requests.exceptions.SSLError: HTTPSConnectionPool(host='sheets.googleapis.com', port=443): Max retries exceeded with url: /v4/spreadsheets/1NqP87YKZFzxs2awftSYT4Uu6BvQTACAUNtxR0_0EhjE?includeGridData=false (Caused by SSLError(SSLError("bad handshake: SysCallError(104, 'ECONNRESET')",),)) It only occures when I try .sheet1 on the .open('FileName') I also get this with .worksheets() and all the others i have found i gspread any help would be appriecated
@prettyprinted6 жыл бұрын
It's hard to say, but it seems to be something with your connection to the API, not the API itself.
@travismiller68186 жыл бұрын
You were correct seems to be a firewall issue in my school
@RaspberryPieman6 жыл бұрын
Hi Anthony - Great Video. I got this working on my Raspberry Pi, straight away using Python3 on Raspbian Stretch, running under user 'pi'. However, I wanted to run it via crontab on reboot. The problem is, that causes it to run under 'root' and then fails with "ImportError: cannot import name 'opentype'". Here is my little example, below. Do you have any idea why this is happening under 'sudo' and how I can fix it? # opentypeProblem.py # run under 'pi' - works OK # pi@raspberrypi:python3 opentypeProblem.py # pi@raspberrypi:done # # run under 'root' (via sudo) - fails # pi@raspberrypi:sudo python3 opentypeProblem.py # Traceback (most recent call last): # File "/home/pi/opentypeProblem.py", line 5, in # from oauth2client.service_account import ServiceAccountCredentials # File "/usr/local/lib/python3.5/dist-packages/oauth2client/service_account.py", line 26, in # from oauth2client import crypt # File "/usr/local/lib/python3.5/dist-packages/oauth2client/crypt.py", line 23, in # from oauth2client import _pure_python_crypt # File "/usr/local/lib/python3.5/dist-packages/oauth2client/_pure_python_crypt.py", line 24, in # from pyasn1_modules.rfc2459 import Certificate # File "/usr/local/lib/python3.5/dist-packages/pyasn1_modules/rfc2459.py", line 20, in # from pyasn1.type import opentype # ImportError: cannot import name 'opentype' import gspread from oauth2client.service_account import ServiceAccountCredentials scope = ['spreadsheets.google.com/feeds', 'www.googleapis.com/auth/drive'] credentials = ServiceAccountCredentials.from_json_keyfile_name('mySpreadsheet.json', scope) gc = gspread.authorize(credentials) wks = gc.open('SampleData').sheet1 name = "Fred" count = 2 wks.append_row([name,count]) print('done')
@prettyprinted6 жыл бұрын
I'm not familiar with the Raspberry Pi, but does your pi user use a virtual environment while your root doesn't?
@RaspberryPieman6 жыл бұрын
Hi Anthony, My pi user is not using a virtual environment. However I did a bit more Googling and found others getting similar problems. One post, shows the use of the pip freeze command to show up differences - here is my result: pi@raspberrypi:$ pip3 freeze | grep pyasn1 pyasn1==0.4.4 pyasn1-modules==0.2.2 pi@raspberrypi:$ sudo pip3 freeze | grep pyasn1 pyasn1==0.1.9 pyasn1-modules==0.2.2 It seems that under sudo, the wrong version of pyasn1 is being picked up. I don't know how to fix this though.
@prettyprinted6 жыл бұрын
Could you just update the one used by sudo? So sudo pip install pyasn1 --upgrade
@RyanWebber-videoArtist6 жыл бұрын
raise HttpAccessTokenRefreshError(error_msg, status=resp.status) oauth2client.client.HttpAccessTokenRefreshError: invalid_scope: Empty or missing scope not allowed. can't seem to get past this.
@RyanWebber-videoArtist6 жыл бұрын
got it... I missed the ', scope' in the setting of the credentials. see: gspread.readthedocs.io/en/latest/oauth2.html
@RezicGming5 жыл бұрын
God damn, I've been banging my head against the wall at this for the past hour before I realized I was missing the '.com' in 'googleapis.com/auth/drive' ...... Thanks.
@alexmealey85896 жыл бұрын
Great Video but I keep getting the same error with my code. Every time I run the code I get "No such file or directory". I've made sure it's the right file name but it still can't get it. Please let me know if anyone has figured this out.
@prettyprinted6 жыл бұрын
Could you give more context for the error message?
@zperk136 жыл бұрын
here's the scope list for anyone who wants to copy and paste it scope = ['spreadsheets.google.com/feeds', 'www.googleapis.com/auth/drive']
@serchforvideos5 жыл бұрын
This should be updated.
@rachitkhandelwal58836 жыл бұрын
getting following error can someone help me on this, i am using pycharm and created a file in my package as credential.json, apart from that every thing is same. Traceback (most recent call last): File "C:/Users/training_d5.01.01/PycharmProjects/untitled/GsheetDemo/gsheetexample.py", line 8, in gc = gspread.authorize(credentials) File "C:\Users\training_d5.01.01\PycharmProjects\untitled\venv\lib\site-packages\gspread\__init__.py", line 38, in authorize client.login() File "C:\Users\training_d5.01.01\PycharmProjects\untitled\venv\lib\site-packages\gspread\client.py", line 51, in login self.auth.refresh(http) File "C:\Users\training_d5.01.01\PycharmProjects\untitled\venv\lib\site-packages\oauth2client\client.py", line 545, in refresh self._refresh(http) File "C:\Users\training_d5.01.01\PycharmProjects\untitled\venv\lib\site-packages\oauth2client\client.py", line 749, in _refresh self._do_refresh_request(http) File "C:\Users\training_d5.01.01\PycharmProjects\untitled\venv\lib\site-packages\oauth2client\client.py", line 819, in _do_refresh_request raise HttpAccessTokenRefreshError(error_msg, status=resp.status) oauth2client.client.HttpAccessTokenRefreshError: invalid_scope: spreadsheets.google.com/feeds is not a valid audience string.
@prettyprinted6 жыл бұрын
Are all the packages the latest? Sometimes Google changes things with what's required to use the API.
@EthanGabis5 жыл бұрын
im having the same problem did you manage to fix that?
@johnmcmanus67196 жыл бұрын
Is that Google API free
@prettyprinted6 жыл бұрын
Yeah within reasonable limits.
@commander_yu_followers5 жыл бұрын
This is the real
@Jenny-ni3bg4 жыл бұрын
arrasooooooooou
@sabecraftgamingandmore13645 жыл бұрын
For me, when I print it, it makes multiple dictionaries, one for each row: {{'Organism': 'Reef shark', 'Consumer(s)': 'None', 'Resource(s)': 'Fan worm, Butterfly fish, Angelfish'}} {{'Organism': 'Yeet', 'Consumer(s)': 'yat', 'Resource(s)': 'yoot'}} {{'Organism': 'yat', 'Consumer(s)': 'ying', 'Resource(s)': 'yong'}} I had a button which adds things to the spreadsheet, and the print button updates it. Here is my code: # Imports import gspread from oauth2client.service_account import ServiceAccountCredentials from tkinter import * # Window window = Tk() window.configure(background="black") # Text Box text_box = Text(window, width=50, height=6, wrap=WORD, background="black", foreground="white") text_box.grid(row=0, column=0, sticky=W) # Scope scope = ['www.googleapis.com/auth/drive'] # Credentials credentials = ServiceAccountCredentials. \ from_json_keyfile_name('credentials.json', scope) # Client client = gspread.authorize(credentials) # Sheet sheet = client.open('PaR Energy Flow').sheet1 # Function def printout(): text_box.delete(0.0, END) data = sheet.get_all_records() text_box.insert(END, data) def add_organism(): o = org.get() c = cons.get() r = res.get() sheet.append_row([o, c, r]) org.delete(0, END) cons.delete(0, END) res.delete(0, END) # Button Button(window, text="Print Spreadsheet Data", width=20, command=printout).grid(row=1, column=0, sticky=W) # Text Entries Label(window, width=20, bg="black", fg="white", text="Organism Name: ").grid(row=2, column=0, sticky=W) org = Entry(window, width="20", bg="black", fg="white") org.grid(row=2, column=1, sticky=W) Label(window, width=20, bg="black", fg="white", text="Organism Consumer(s): ").grid(row=3, column=0, sticky=W) cons = Entry(window, width="20", bg="black", fg="white") cons.grid(row=3, column=1, sticky=W) Label(window, width=20, bg="black", fg="white", text="Organism Resource(s): ").grid(row=4, column=0, sticky=W) res = Entry(window, width="20", bg="black", fg="white") res.grid(row=4, column=1, sticky=W) # Button Button(window, text="Add Organism", width=20, command=add_organism).grid(row=5, column=0, sticky=W) # Run mainloop() It would be appreciated if someone could help me. I want it all to be in one list like you have.
@DarickBrokaw5 жыл бұрын
“pip is not recognized as an internal or external command” error. I had this error and used the following fix appuals.com/fix-pip-is-not-recognized-as-an-internal-or-external-command/ NOTE: For those extremely new to programming like me this video is done in the Win+R (Run) CMD (Command Line).