使用 google api v4(google 张)按值查找单元格
Find cell by value with google api v4 (google sheets)
我可以使用 google api v4 按值查找单元格吗?在我的任务中,我想更改背景颜色 if cell_value == my_value
。
我只知道它的一种变体:
- 使用 gspread 我可以找到单元格坐标
- 使用 google api v4 我可以更改背景颜色
但我只想使用 google api v4,因为使用 gspread 按值查找单元格非常慢。
支持使用表格 API 获取单元格的值。检查 Sheets API Reading guide。
在 Basic Reading.
中可以找到供阅读的代码示例
读取单个范围
以下 spreadsheets.values.get 请求读取存储在 Sheet1!A1:D5 范围内的值,并 returns 在响应中读取它们。省略尾随的空行和列。
请求协议如下所示。读写值指南展示了如何使用 Google API 客户端库以不同语言实现读取。
GET https://sheets.googleapis.com/v4/spreadsheets/spreadsheetId/values/Sheet1!A1:D5
JSON 应该是这样的:
{
"find": string,
"replacement": string,
"matchCase": boolean,
"matchEntireCell": boolean,
"searchByRegex": boolean,
"includeFormulas": boolean,
// Union field scope can be only one of the following:
"range": {
object(GridRange)
},
"sheetId": number,
"allSheets": boolean,
// End of list of possible types for union field scope.
}
select 只是范围选项之一(范围、sheetID 或 allSheets)。
我可以使用 google api v4 按值查找单元格吗?在我的任务中,我想更改背景颜色 if cell_value == my_value
。
我只知道它的一种变体:
- 使用 gspread 我可以找到单元格坐标
- 使用 google api v4 我可以更改背景颜色
但我只想使用 google api v4,因为使用 gspread 按值查找单元格非常慢。
支持使用表格 API 获取单元格的值。检查 Sheets API Reading guide。 在 Basic Reading.
中可以找到供阅读的代码示例读取单个范围
以下 spreadsheets.values.get 请求读取存储在 Sheet1!A1:D5 范围内的值,并 returns 在响应中读取它们。省略尾随的空行和列。
请求协议如下所示。读写值指南展示了如何使用 Google API 客户端库以不同语言实现读取。
GET https://sheets.googleapis.com/v4/spreadsheets/spreadsheetId/values/Sheet1!A1:D5
JSON 应该是这样的:
{
"find": string,
"replacement": string,
"matchCase": boolean,
"matchEntireCell": boolean,
"searchByRegex": boolean,
"includeFormulas": boolean,
// Union field scope can be only one of the following:
"range": {
object(GridRange)
},
"sheetId": number,
"allSheets": boolean,
// End of list of possible types for union field scope.
}
select 只是范围选项之一(范围、sheetID 或 allSheets)。