Skip to content

Instantly share code, notes, and snippets.

@david-macleod
Created October 12, 2018 20:42
Show Gist options
  • Save david-macleod/eed7dabee0dac4c0b47f66fa9012c7d6 to your computer and use it in GitHub Desktop.
Save david-macleod/eed7dabee0dac4c0b47f66fa9012c7d6 to your computer and use it in GitHub Desktop.
Google drive authentication in colab notebook
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
from google.colab import auth
from oauth2client.client import GoogleCredentials
auth.authenticate_user()
gauth = GoogleAuth()
gauth.credentials = GoogleCredentials.get_application_default()
drive = GoogleDrive(gauth)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment