I have a google sheet that I am inserting/updating the values of based on the results of some API calls I am making in a python script.
Following the gspread documentation, I'm currently fetching the range from the sheet, then updating the values, then writing it back.
But I don't care about the values in the sheet, I would rather write blindly to it - saving me precious API read quota.
Is there a way I can write to the cells without reading them first?
I've googled around for anyone having the same problem and I can't find anywhere that tells me how I can do this (or even if I can at all)
Current code:
(rowData is the data I have gathered previously in the python script that I now want to write to the gsheet)
try:
rowToUpdate = sheet.range("A"+str(index)+":Q"+str(index))
except Exception as e:
print("Couldn't fetch rowToUpdate, error message was: ")
print(repr(e))
try:
for cell, value in zip(rowToUpdate, rowData):
cell.value = value
sheet.update_cells(rowToUpdate)
Ideally I would just do something like:
try:
for cell, value in zip(rowToUpdate, rowData):
cell.value = value
sheet.update_cells(rowToUpdate)```