Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/306.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用Google API v4 for Python从Google工作表中获取更改历史记录?_Python_Python 3.x_Google Sheets Api_Gspread - Fatal编程技术网

如何使用Google API v4 for Python从Google工作表中获取更改历史记录?

如何使用Google API v4 for Python从Google工作表中获取更改历史记录?,python,python-3.x,google-sheets-api,gspread,Python,Python 3.x,Google Sheets Api,Gspread,我已经创建了一个python脚本,使用GoogleAPIv4将我的数据库与GoogleSheet同步 这是我的片段, 进口gspread 从oauth2client.service\u帐户导入ServiceAccountCredentials scope = ['https://spreadsheets.google.com/feeds', 'https://www.googleapis.com/auth/drive'] creds = ServiceAccountCredentials.fro

我已经创建了一个python脚本,使用GoogleAPIv4将我的数据库与GoogleSheet同步

这是我的片段, 进口gspread 从oauth2client.service\u帐户导入ServiceAccountCredentials

scope = ['https://spreadsheets.google.com/feeds', 'https://www.googleapis.com/auth/drive']
creds = ServiceAccountCredentials.from_json_keyfile_name('mycred.json', scope)
client = gspread.authorize(creds)
sheet = client.open("WORKBOOK NAME").worksheet('SHEET NAME')
print(sheet.get_all_records())
但是从上面的代码中,我得到了完整的表格记录, 这是一个使用cron的自动同步,所以一直获取所有记录是浪费时间

我查过了,但没找到


是否有一种方法可以单独从Google Sheet API获取更改历史?

不幸的是,在当前阶段,Google API无法直接检索每个历史的差异。因此,我认为需要使用脚本比较当前数据和以前的数据。我为这种情况道歉。我也有同样的想法。但这很复杂,也很昂贵谢谢你的回复。为了正确地看到您的目标,我可以问一下您想要的示例输入和输出吗?因为从您的问题中,我无法理解
更改历史记录
的详细值。当然,请删除您的个人信息。正如Tanaike所说,不可能从Sheets API获取修订历史记录,尽管驱动器APOI具有允许您下载和发布文件修订的功能,但是否可以将其应用于您的用例以比较和获取文件更改?