burnash/gspread

get_all_worksheet_values feature request

已关闭

#1,002 创建于 2022年2月24日

 (7 条评论) (0 个反应) (0 位负责人)Python (979 个派生)batch import
Feature Requestgood first issue

仓库指标

星标
 (7,499 个星标)
PR 合并指标
 (平均合并 7天 17小时) (30 天内合并 2 个 PR)

描述

Is your feature request related to a problem? Please describe. API limits is the problem. When wanting to read values from all or most of the worksheets in a google sheets I have to get the values of each worksheet one at a time, that is one API call per worksheet. This can make the program reach the API limit very quickly if enough users access the program.

Describe the solution you'd like a get_all_worksheet_values() function that uses the batchGet endpoint to retrieve multiple worksheet data in one API call. If a list of worksheet names are given, then use those, else grab all the worksheet names and retrieve all their values. I know the latter would involve making two API calls, but it would be worth on most cases.

I know the library has a values_batch_get() method. What I am requesting is an abstraction to this method.

I would prefer the function to return a dict of all the worksheet values, mapped by the worksheet name/title.

Describe alternatives you've considered Only alternatives are calling for each worksheet data at a time, or just using values_batch_get().

Additional context I am happy to tackle this feature, would just like to get some input from the devs on if the approach is correct and get any feedback or improvements.

贡献者指南