Using batch_get for multiple pages such as spreadsheets.values.batchGet supports
- Dominant language
- Python
- Stars
- 7.5k
- Forks
- 979
- PR merge metrics
- No merged PRs in 30d
Description
I tried using `batch_get` to collect values in a single call:
```
sheet = client.open_by_key('XXXXXXXXXXXXXXXXXXXXXXXX')
print(sheet.batch_get(["'Page 1'!A1:A5","'Page 2'!A1:A5"]))
```
But I realized that it only accepts by setting the desired page after `open_by_key`, like `open_by_key('...').worksheet('...')`.
That way are limited to using it on a single page.
I would like to request an "update" to this option that gives us the freedom to work with multiple pages in a single call, as is possible through the API (https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/batchGet):


```
{
"spreadsheetId": "XXXXXXXXXXXXXXXXXXXXXXXX",
"valueRanges": [
{
"range": "'Page 1'!A1:A5",
"majorDimension": "ROWS",
"values": [
[
"id"
],
[
"1"
],
[
"2"
],
[
"3"
],
[
"4"
]
]
},
{
"range": "'Page 2'!A1:A5",
"majorDimension": "ROWS",
"values": [
[
"id"
],
[
"1"
],
[
"2"
],
[
"3"
],
[
"4"
]
]
}
]
}
```
Contributor guide
Assessment
This issue has not been assessed yet.