【发布时间】:2019-09-19 19:24:50
【问题描述】:
我需要使用 Python 脚本读取现有的 google sheet。有什么方法可以为现有的电子表格启用 Google Sheets 或 Drive API(这样我就可以下载 Python 应用程序的必要凭据)?
【问题讨论】:
标签: python google-sheets google-drive-api
我需要使用 Python 脚本读取现有的 google sheet。有什么方法可以为现有的电子表格启用 Google Sheets 或 Drive API(这样我就可以下载 Python 应用程序的必要凭据)?
【问题讨论】:
标签: python google-sheets google-drive-api
如果您查看 Google Developers 快速入门,您可以看到常量
# The ID and range of a sample spreadsheet.
SAMPLE_SPREADSHEET_ID = '1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms'
SAMPLE_RANGE_NAME = 'Class Data!A2:E'
如果您查看工作表 URL,您会发现它有一个单独的 ID。您可以将代码中的电子表格 ID 替换为您自己的 URL,并根据您的特定应用程序更改您要查询的范围。
【讨论】: