Skip to content
This repository was archived by the owner on Jul 22, 2021. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions examples/alt_credential_auth.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from oauth2client.service_account import ServiceAccountCredentials
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive

GOOGLE_SCOPES = ['https://www.googleapis.com/auth/drive']
creds = ServiceAccountCredentials.from_json_keyfile_name('service-key.json', GOOGLE_SCOPES)

gauth = GoogleAuth()
gauth.credentials = creds

drive = GoogleDrive(gauth)

# Now do stuff as normal!