burnash/gspread

get_all_worksheet_values feature request

Open

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

在 GitHub 查看
 (6 评论) (0 反应) (0 负责人)Python (6,606 star) (960 fork)batch import
Feature Requestgood first issue

描述

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.

贡献者指南