Answer the question
In order to leave comments, you need to log in
How to update a spreadsheet sheet in google drive using python?
Hey! Can you please tell me how can I update a whole sheet in Google spreadsheets with data from xml or csv file using python and google spreadsheet api? Is there a method that takes a file as an argument? Preferably with gspread.
While it turns out to update only the specified cells, rows and columns
Answer the question
In order to leave comments, you need to log in
gspread has an import_csv() method
import gspread
API_KEY = '/../../91caf1a6016.json'
SPREADSHEET_ID = 'hlrauXcTXeQZ_H-Kwn5sVucQzWam-kByJsF1VxtscNLo'
scope=[
'https://spreadsheets.google.com/feeds',
'https://www.googleapis.com/auth/drive'
]
result = 'строка с CSV данными, прочитайте из вашего файла'
credentials = ServiceAccountCredentials.from_json_keyfile_name(API_KEY, scope)
gc = gspread.authorize(credentials)
gc.import_csv(SPREADSHEET_ID, result)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question