[英]Take data from private google spreadsheet
I have a Google Spreadsheet which I'm sharing with several person. 我有一个Google电子表格,我要与几个人共享。 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.
我在考虑使用python,因为Google似乎为此提供了很好的API。
Have someone an example on how to connect to Google Spreadsheet ? 有没有关于如何连接到Google Spreadsheet的示例? I read the api, but I don't get how does the OAuth 2.0 thing works...
我阅读了api,但不知道OAuth 2.0的工作原理是什么...
Many thanks :) 非常感谢 :)
To perform read and write operations on a Google Spreadsheet, OAuth 2.0 will not be necessary. 要在Google Spreadsheet上执行读写操作,则不需要OAuth 2.0。 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.
如这些用于读取和写入 Google Spreadsheet的示例所示,为了能够访问SpreadSheet,您必须在代码中包含相关帐户的用户名密码。 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. 另外,请记住要
import gdata.spreadsheet.service
和代码可能需要的任何其他相关库。 And if you're new, this would also be a good place to start. 如果您是新手, 这也是一个不错的起点。 Hope this helps!
希望这可以帮助!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.