我试着使用oauth2client和oauth2client来对googlesheet进行操作,但我遇到的问题是,当使用problem时,它需要一个作用域。我不知道范围是什么。以下是oauth2client的使用代码。
import gspread
from oauth2client.service_account import ServiceAccountCredentials
scope = ['https://spreadsheets.google.com/feeds']
credentials = ServiceAccountCredentials.from_json_keyfile_name('gspread-april-2cd … ba4.json', scope)
gc = gspread.authorize(credentials)
wks = gc.open("Where is the money Lebowski?").sheet1发布于 2016-07-14 21:04:19
OAuth作用域表示您请求用户为您的应用程序授权的权限。
在使用Google Sheets API v3时,您使用的作用域是唯一可用于授权您的请求的作用域。
https://spreadsheets.google.com/feeds而如果您使用的是Google Sheets API v4,则现在可以使用以下两个作用域之一:
https://www.googleapis.com/auth/spreadsheets.readonly它允许对用户的工作表及其属性进行只读访问,并且
https://www.googleapis.com/auth/spreadsheets它允许对用户的工作表及其属性进行读/写访问。
https://stackoverflow.com/questions/38335432
复制相似问题