gspread

Appending pandas Data Frame to Google spreadsheet

大憨熊 提交于 2019-11-29 06:56:56
Case: My script returns a data frame that needs has to be appended to an existing google spreadsheet as new rows of data.As of now, I'm appending a data frame as multiple single rows through gspread. My Code: import gspread import pandas as pd df = pd.DataFrame() # After some processing a non-empty data frame has been created. output_conn = gc.open("SheetName").worksheet("xyz") # Here 'SheetName' is google spreadsheet and 'xyz' is sheet in the workbook for i, row in df.iterrows(): output_conn.append_row(row) Is there a way to append entire data-frame rather than multiple single rows? I can

Can I write whole lines in Google Spreadsheets using gspread in python?

送分小仙女□ 提交于 2019-11-28 06:02:29
问题 I am trying to write a simple script that will take csv as an input and write it in a single spreadsheet document. Now I have it working however the script is slow. It takes around 10 minutes to write cca 350 lines in two worksheets. Here is the script I have: #!/usr/bin/python import json, sys import gspread from oauth2client.client import SignedJwtAssertionCredentials json_key = json.load(open('client_secrets.json')) scope = ['https://spreadsheets.google.com/feeds'] # change to True to see

How to find the first empty row of a google spread sheet using python GSPREAD?

半世苍凉 提交于 2019-11-27 20:48:28
I am struggling to write codes that find me the first empty row of a google sheet. I am using gspread package from github.com/burnash/gspread I would be glad if someone can help :) I currently have just imported modules and opened the worksheet scope = ['https://spreadsheets.google.com/feeds'] credentials = ServiceAccountCredentials.from_json_keyfile_name('ddddd-61d0b758772b.json', scope) gc = gspread.authorize(credentials) sheet = gc.open("Event Discovery") ws = sheet.worksheet('Event Discovery') I want to find row 1158 which is the first empty row of the worksheet with a function, which

Appending pandas Data Frame to Google spreadsheet

一笑奈何 提交于 2019-11-27 03:27:19
问题 Case: My script returns a data frame that needs has to be appended to an existing google spreadsheet as new rows of data.As of now, I'm appending a data frame as multiple single rows through gspread. My Code: import gspread import pandas as pd df = pd.DataFrame() # After some processing a non-empty data frame has been created. output_conn = gc.open("SheetName").worksheet("xyz") # Here 'SheetName' is google spreadsheet and 'xyz' is sheet in the workbook for i, row in df.iterrows(): output_conn

gspread authentication throwing insufficient permission

杀马特。学长 韩版系。学妹 提交于 2019-11-26 23:35:01
问题 Using developers.google.com we created api user and downloaded credentials as json file. Now On my macbook gspread authentication is working fine while using credentials.json. when moved same config to linux server on aws its giving 403 insufficient permission error. Pip and python version are same. exception gspread.v4.exceptions.APIError: { "error": { "errors": [ { "domain": "global", "reason": "insufficientPermissions", "message": "Insufficient Permission" } ], "code": 403, "message":

How to find the first empty row of a google spread sheet using python GSPREAD?

随声附和 提交于 2019-11-26 22:58:48
问题 I am struggling to write codes that find me the first empty row of a google sheet. I am using gspread package from github.com/burnash/gspread I would be glad if someone can help :) I currently have just imported modules and opened the worksheet scope = ['https://spreadsheets.google.com/feeds'] credentials = ServiceAccountCredentials.from_json_keyfile_name('ddddd-61d0b758772b.json', scope) gc = gspread.authorize(credentials) sheet = gc.open("Event Discovery") ws = sheet.worksheet('Event