def __init__(self, cfg_name='google_drive'):
import gspread
from oauth2client.client import SignedJwtAssertionCredentials
credentials_json = json.loads(luigi.configuration.get_config().get(cfg_name, 'credentials_json'))
client_email = credentials_json["client_email"]
private_key = credentials_json["private_key"]
scope = ['https://spreadsheets.google.com/feeds']
credentials = SignedJwtAssertionCredentials(client_email, private_key.encode(), scope)
self.client = gspread.authorize(credentials)
评论列表
文章目录