简体   繁体   English

从私人Google电子表格中获取数据

[英]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.

相关问题 需要从文本文件到电子表格进行数据分析 - Need to take data from text file to spreadsheet for analysis 如何从谷歌电子表格中提取数据到笔记本 - How to extract data from a google spreadsheet to notebook 如何使用从 Binance API 收到的数据更新谷歌电子表格 - How to update a google spreadsheet with data received from a Binance API 从gmail中提取数据添加到电子表格 - Google应用程序脚本 - extract data from gmail add to spreadsheet- Google apps script 使用python将数据从csv文件解析到Google Spreadsheet - Parsing data from csv file to Google Spreadsheet with python 使用gdata库从公共Google电子表格中检索数据? - Retrieve data from public Google Spreadsheet using gdata library? 将Google电子表格数据转换为pandas数据框 - Google spreadsheet data into pandas dataframe 从 csv 文件或来自 google 文档的电子表格填充 appengine 数据库中的数据 - Populating data in appengine database from a csv file or spreadsheet from google docs 通过标题名称访问 Google 电子表格数据 - Accessing Google Spreadsheet data via header names 将 pandas 数据框附加到 Google 电子表格 - Appending pandas Data Frame to Google spreadsheet
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM