код
import os
import gspread
from df2gspread import df2gspread as d2g
path = os.path.abspath('json_from_google.json')
with open(path,'r'):
scope = ['
https://spreadsheets.google.com/feeds',
'
https://www.googleapis.com/auth/drive']
credentials = ServiceAccountCredentials.from_json_keyfile_name(
'json_from_google.json', scope)
gc = gspread.authorize(credentials)
spreadsheet_key = 'ключ документа из гугл-таблиц'
wks_name = 'name'
d = {'col1': [1, 2], 'col2': [3, 4]}
df = pd.DataFrame(data=d)
d2g.upload(df, spreadsheet_key, wks_name, credentials=credentials, row_names=True)
Сообщений об ошибках нет