import gspread
headers = gspread.httpsession.HTTPSession(headers={'Connection': 'Keep-Alive'})
con = gspread.Client(auth=('you@gmail.com', 'password'), http_session=headers)
python gspread google spreadsheet keeping connection alive