burnash/gspread

get_all_worksheet_values feature request

Open

#1,002 opened on Feb 24, 2022

View on GitHub
 (6 comments) (0 reactions) (0 assignees)Python (6,606 stars) (960 forks)batch import
Feature Requestgood first issue

Description

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.

Contributor guide