I'm currently writing a python program which scrapes data from a website and then writes that info into a google spreadsheet. Based on the data contained in each row the data is separated into different worksheets inside of the main spreadsheet. I've been sending multiple requests using gspread's batch_update() function but it only formats sheet1 and doesn't format the subsequent pages. What can I do to make all of my sheets be formatted the same.
batch_update() calls the spreadsheets.batchUpdate() method through the googlesheets api which should affect the whole spreadsheet instead of the first worksheet which I don't understand
creds = ServiceAccountCredentials.from_json_keyfile_name("creds.json", scope)
client = gspread.authorize(creds)
vt = client.open(sheetName)
formatRequests = []
formatRequests.append({
"repeatCell" : {
"range" : {
"startColumnIndex" : 0,
"endColumnIndex" : 1
},
"cell" : {
"userEnteredFormat" : {
"numberFormat" : {
"type": "DATE",
"pattern" : "mmm dd, yyyy, hh:mm am/pm"
}
}
},
"fields" : "userEnteredFormat.numberFormat"
}
})
#... A bunch of other formatting appends
body = {
'requests' : formatRequests
}
vt.batch_update(body)
This only formats the first page in the spreadsheet