gspread icon indicating copy to clipboard operation
gspread copied to clipboard

Iterators/generators on spreadsheet items

Open nvitucci opened this issue 10 years ago • 2 comments

I haven't found any "lightweight" versions of the get_* methods, i.e. methods returning iterators or generators on the results. This makes reading a large spreadsheet memory-intensive. Is there any specific reason behind this choice?

nvitucci avatar Feb 25 '16 11:02 nvitucci

I'd also really like to see this.

Luttik avatar Apr 19 '16 15:04 Luttik

Hi, having generators on spreadsheets when reading cells and not load everything in memory will implie doing more API calls. It has been reported multiple times that the API limits are a strong restrictions for most users. Gspread tends to do less API call then the opposite to prevent reaching the threshold.

One could say that it depends on the use case and some options could be introduced like "paging" or "pre-fetch" that will either load only some part of the spreadsheet or everything depending on the use case. Remember that the first case will encounter a blocking step when loading new lines at some points.

lavigne958 avatar May 06 '21 07:05 lavigne958