Reduce API request number for API call limitation reasons.
See original GitHub issueHi,
After reading your lib, I appreciate your contribution to an easy, fast Google SpreadSheet API.
I saw in class SpreadSheet
, you call every single spreadsheets.get
for every single function get_workspace
. I think you should update all of workspace metadata in __init__
method of SpreadSheet
class for reducing call gg API.
Thanks again
Issue Analytics
- State:
- Created 2 years ago
- Comments:6
Top Results From Across the Web
How to handle API rate limits: Do your integrations work at ...
Typically, rate-limit algorithms track the number of requests over a short period of time, such as one second or one minute. If requests...
Read more >Best practices for avoiding rate limiting | Zendesk Developer ...
Reducing the number of API requests · Optimize your code to eliminate any unnecessary API calls. · Cache frequently used data. · Sideload...
Read more >Everything You Need To Know About API Rate Limiting
Best Practices For API Rate Limiting · Are requests throttled when they exceed the limit? · Do new calls and requests incur additional...
Read more >How to avoid hitting rate limits in API integration - Elastic.io
We'll go through different API rate limiting techniques as well as strategies and workarounds to recover from them or generally avoid them.
Read more >Limits and Quotas on API Requests | Analytics Core Reporting ...
If the quota of requesting a Google Analytics API is exceeded, the API returns an error code 403 or 429 and a message...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I checked the methods you mention, yes we call the method
fetch_sheet_metadata
each time. But in the case of__init__
we only keep theproperties
section and in the other cases we only keep thesheet
section.We could keep the list of sheets from the
sheet
section in the__init__
but gspread is asyncrhonous and does not handle concurrency. So if we get the list of sheets at__init__
and later try to get a sheet, it might have change, it might not exists anymore. This is why when you request a specific sheet usingget_worksheet
orworksheet
we must call the API again and retrieve the latest informations.This is why we can’t cache the response from the GET request.
Hello @sandl99 ,
Thabk you very much we are happy that you like gspread.
I don’t understand what’s you mean sorry, you mention
workspaces
but we don’t have such objects, do you meanworksheets
?