I'm trying to use OAuth2 and gspread to use Python to manipulate Google Sheets. However, I keep running into this error:
invalid_scope: https://spreadsheets.google.com/feeds is not a valid audience string.
Initially, I had the scope as a list, however, I saw another answer on StackOverflow saying that the scope should be a space delimited string instead. I tried changing it over but the error still occured.
Here is my code:
import gspread
from oauth2client.service_account import ServiceAccountCredentials
scope = ' '.join(['https://spreadsheets.google.com/feeds', 'https://googleapis.com/auth/drive'])
credentials = ServiceAccountCredentials.from_json_keyfile_name("SpreadsheetExample-bec536232207.json", 'https://spreadsheets.google.com/feeds https://googleapis.com/auth/drive')
gc = gspread.authorize(credentials)
wks = gc.open("test").sheet1
print(wks.get_all_records())`