-
Notifications
You must be signed in to change notification settings - Fork 951
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
get_all_worksheet_values feature request #1002
Comments
I was able to make a demo, it works!
which returns a dict, the worksheet values keyed by the worksheet title. Everything is done in two API calls:
To make it production worthy I would add the function to take the Query Parameter parm from Thoughts @lavigne958? |
Hi @JPGarCar Thank you for this proposal. It looks great. I would only do some minor changes (the way you compute a column number to a column name (1->A) but the major part of you code can be put into gspread. If you like you can open the PR then I put my comments then we merge it, or you want send a patch (i can guide you) if you like so when I merge it you appear in the contributors list. |
I'll make a PR! Thanks @lavigne958 |
before you start here are 2 comments that can already take:
the rest is fine but I would need to take a deeper look and try it first to validate it. |
Hi! Was this ever completed? If not I can put up a PR following the earlier replies' guidance. |
nope it has not been done, plese go ahead and start a PR we'll start working from there. We do need to work on the format of the returned values though 🤔 either you open the PR and we'll work from there and proceed to any changes if necessary or you can pos there a comment of the returned format, the new functions you'll create etc and we can discuss it first, either way if fine to me 😉 thank you for your help |
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.
The text was updated successfully, but these errors were encountered: