Skip to content Skip to sidebar Skip to footer

Gspread & Oauth2 On Python 3.4 - Oauth Does Not Support Indexing

I want to use gspread and since client authentication is outdated, I'm trying with Oauth2. I'm new to both gspread & Oauth2. Piecing together from this basic Oauth2 example

Solution 1:

I've figured it out. If anyone else is interested, this is what I needed to do

import json
import gspread
from oauth2client.client import SignedJwtAssertionCredentials
json_key = json.load(open('Gspread-762ec21ac2c5.json'))
scope = ['https://spreadsheets.google.com/feeds']
credentials = SignedJwtAssertionCredentials(json_key['client_email']
    , bytes(json_key['private_key']
    , 'utf-8')
    , scope)
gc = gspread.authorize(credentials)
wks = gc.open("mytestfile").sheet1

Post a Comment for "Gspread & Oauth2 On Python 3.4 - Oauth Does Not Support Indexing"