Uncategorized

google sheets – Using Python’s gspread, can I read the modifiedTime without fetching the entire spreadsheet? I want to use a local cache if there was no change


I’m using gspread to load read from my spreadsheets and it’s working great. However, I’m hitting Google data caps quite often, especially when I’m testing.

I created a caching method that uses a local copy if it is less than a minute old. However, when debugging, I often have to change things in the spreadsheet and see an immediate change in the execution of the code. On the other hand, because not all calls during debugging need a fresh copy, I’ll hit the data caps quickly if I remove the caching.

Is there a way to check if the spreadsheet has changed before fetching it? I know there is a field modifiedTime in _properties of a spreadhseet, but it doesn’t seem to have an accessor method. This suggests to me that there is a mechanism for caching hidden. Is there one.

It also seems to me that to populate modifiedTime you need to read the entire spreadsheet anyways. Is that true?

So here is the question: how do I get the last modified time of a spreadhseet without using my data cap? Preferably using only gspread?



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *