1

Can anyone tell me how to put project id of shared drive in GoogleAuth()?

I have tried the below chunk of code but none of them are working:

auth = GoogleAuth({'id': 'projectid'}) 
auth = GoogleAuth({'project_id': 'projectid'})
auth = GoogleAuth({'project': 'projectid'})

Below is my piece of code where I am trying to upload a .csv file to a shared drive. I assume that the project ID is the string after the last '/' in the URL which appears after we double click on the desired drive folder.

from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive

auth = GoogleAuth()
drive = GoogleDrive(gauth)
file1 = drive.CreateFile()
file1.SetContentFile('file_name.csv')
file1.Upload()`
blackbrandt
  • 2,010
  • 1
  • 15
  • 32
Sagnik
  • 1,446
  • 1
  • 9
  • 13
  • Have you completed oauth process? Is the client authorized at all? – abdusco Jul 03 '19 at 20:30
  • Yes, I have completed the oauth process and the client is authorized. – Sagnik Jul 04 '19 at 16:16
  • Did you perform this step? `The downloaded file has all authentication information of your application. Rename the file to “client_secrets.json” and place it in your working directory.` https://gsuitedevs.github.io/PyDrive/docs/build/html/quickstart.html#authentication – abdusco Jul 04 '19 at 16:20
  • Yes. I have done it. – Sagnik Jul 04 '19 at 20:17

0 Answers0