Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import gspread
- from oauth2client.service_account import ServiceAccountCredentials
- info = {
- "type": "service_account",
- "project_id": "PROJECTID",
- "private_key_id": "key",
- "private_key": "key",
- "client_email": "email",
- "client_id": "id",
- "auth_uri": "https://accounts.google.com/o/oauth2/auth",
- "token_uri": "https://oauth2.googleapis.com/token",
- "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
- "client_x509_cert_url": "url"
- }
- scope = ['https://spreadsheets.google.com/feeds', 'https://www.googleapis.com/auth/drive']
- creds = ServiceAccountCredentials.from_json_keyfile_dict(info, scope)
- clients = gspread.authorize(creds)
- wks = clients.open('GOOGLE_SHEET')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement