burnash/gspread

get_all_worksheet_values feature request

クローズ

#1,002 opened on 2022/02/24

 (7 件のコメント) (0 件のリアクション) (0 人の担当者)Python (979 件のフォーク)batch import
Feature Requestgood first issue

Repository metrics

Stars
 (7,496 個のスター)
PR merge metrics
 (平均マージ 7d 17h) (30d で 2 merged PRs)

説明

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.

コントリビューターガイド