简体   繁体   中英

Take data from private google spreadsheet

I have a Google Spreadsheet which I'm sharing with several person. I want to built a script to search for some rows and take cells values and process a program locally afterwards. I was thinking going with python, as it seems Google provide a good API for it.

Have someone an example on how to connect to Google Spreadsheet ? I read the api, but I don't get how does the OAuth 2.0 thing works...

Many thanks :)

To perform read and write operations on a Google Spreadsheet, OAuth 2.0 will not be necessary. As shown in these samples for reading as well as writing to a Google Spreadsheet, in order to be able to access the SpreadSheet you must include the username-password of the related account in your in your code. And then using them in the following manner (as shown in the writing sample) to access the Spreadsheet:

spr_client = gdata.spreadsheet.service.SpreadsheetsService()
spr_client.email = email
spr_client.password = password
spr_client.source = 'Example Spreadsheet Writing Application'
spr_client.ProgrammaticLogin()

Also, do remember to import gdata.spreadsheet.service and any other related library that you might need for your code. And if you're new, this would also be a good place to start. Hope this helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM