gspread

Python SSL error Decryption failed or bad record mac

Deadly 提交于 2020-08-22 12:14:21
问题 I am trying to use gspread python module to read the google spreadsheet. But I am getting some error from ssl. I have tried to look into this, but couldn't able to make it work. The gspread module is using python request internally which seems to be use python's ssl package. The code (I have written) and stack trace is provided below with env details. Env: python: 2.7.13 Ubuntu: 14.04 openssl: 1.0.1f 6 Jan 2014 Code: import gspread from oauth2client.client import SignedJwtAssertionCredentials

Using gspread to read from a Google Drive Spreadsheet without logging in

旧巷老猫 提交于 2020-07-22 11:34:25
问题 I'm using the module gspread to (attempt) to parse a specific spreadsheet on my Google Drive. However, I eventually want to turn this project into a web application, so naturally I don't want to give away my login information. However, since I only need to read the spreadsheet, shouldn't there be a way to use gspread to read the contents of the file without having to log in? I've tried: gc = gspread.Client(None) sheet = gc.open_by_key(KEY) But this fails with the error (<class 'xml.etree

How to use the scope https://www.googleapis.com/auth/drive.file correctly

吃可爱长大的小学妹 提交于 2020-06-27 08:47:11
问题 I have tried accessing a Google Sheets file in my Google Drive with this code: import gspread from oauth2client.service_account import ServiceAccountCredentials scope = ['https://www.googleapis.com/auth/drive'] credentials = ServiceAccountCredentials.from_json_keyfile_name('credentials.json', scope) gc = gspread.authorize(credentials) wks = gc.open('my_test').sheet1 print(wks.get_all_records()) I have then created a spreadsheet called my_test in my drive and shared it with the email in

insert_row or append_row with Gspread python

自作多情 提交于 2020-04-30 07:40:51
问题 When I run my script insert_row and append_row are putting each letter of the string into a new column. Trying to insert an id '877' for example. Didn't like integers worksheet.append_row(877) Returns *** TypeError: object of type 'int' has no len() Tried wrapping this in the str() and it creates a new column for each letter. What am I doing wrong?! 回答1: Strings have lenght (number of characters); integers don't. If you want to achieve a similar result, do this: worksheet.append_row('877')

insert_row or append_row with Gspread python

独自空忆成欢 提交于 2020-04-30 07:40:27
问题 When I run my script insert_row and append_row are putting each letter of the string into a new column. Trying to insert an id '877' for example. Didn't like integers worksheet.append_row(877) Returns *** TypeError: object of type 'int' has no len() Tried wrapping this in the str() and it creates a new column for each letter. What am I doing wrong?! 回答1: Strings have lenght (number of characters); integers don't. If you want to achieve a similar result, do this: worksheet.append_row('877')

How do you copy values from one spreadsheet to another using gspread or some other way?

孤人 提交于 2020-04-13 08:21:53
问题 (beginner) I'm attempting to copy values from one spreadsheet to another using python. I'm using gspread but I can't seem to figure out how to copy the values from my first spreadsheet to the other. How can I copy values from the first spreadsheet and paste it on the other using python? Here is the updated code:import gspread from oauth2client.service_account import ServiceAccountCredentials scope = ['https://spreadsheets.google.com/feeds','https://www.googleapis.com/auth/spreadsheets','https

Accessing an organization-restriced Google Sheet via API

ⅰ亾dé卋堺 提交于 2020-03-23 20:05:08
问题 I am writing a Python 3.7 script that needs to read data from a Google Spreadsheet. The spreadsheet in question belongs to an Organization that my work Google Account is part of: let's just call it "Organization". The spreadsheet permissions are set as "Anyone at Organization with the link can view". This detail has been preventing my application from working. I went to the credentials dashboard at https://console.cloud.google.com/apis/credentials while being authenticated with my account in