Questions tagged [pydrive]

PyDrive is a wrapper library of google-api-python-client that simplifies many common Google Drive API tasks.

PyDrive is a wrapper library of google-api-python-client that simplifies many common Google Drive API tasks.

269 questions
6
votes
4 answers

Moving Folder from Google Colab to Google Drive

I am using Google Colab for Machine Learning. Many times I need to download solution CSV using Google Drive using Pydrive. As shown below from pydrive.auth import GoogleAuth from pydrive.drive import GoogleDrive from google.colab import auth from…
Abhik Sarkar
  • 901
  • 3
  • 12
  • 32
6
votes
1 answer

pydrive get only folders from list

I use library pydrive for google drive. Now I need get all folders (root, parent, child) name in google drive. I have found this: self.drive.ListFile().GetList() but it returns all the files. Can I get only all folders in google drive?
r1299597
  • 609
  • 3
  • 10
  • 20
6
votes
1 answer

Upload a Pandas DataFrame as Excel file directly to Google Drive using PyDrive

I'm trying to write a pandas.DataFrame directly to Google Drive, without first writing the file out locally. I can't find a solution and not sure if it is even possible. I've tried the code below, but I get an AttributeError. import pandas as…
cyril
  • 2,976
  • 5
  • 19
  • 26
6
votes
5 answers

Cannot move a file across folders in google drive using PyDrive

I have been trying to move file from one folder to another in my google drive using PyDrive file2 = drive.CreateFile({'id': }) file2['parents']= file2.Upload() Is it possible to change folders like this? If not…
gooner
  • 61
  • 1
  • 4
6
votes
1 answer

PyDrive guath.Refresh() and Refresh Token Issues

Like others, I'm trying to get the Google refresh token to work in order to run scheduled tasks that copy and rename files. When I first manually authenticate within a terminal, my url ends in &access_type=offline. However, when I go in and try to…
user1644030
  • 251
  • 3
  • 10
5
votes
1 answer

How to connect pydrive with an Service Account

Does anyone have any example or documentation how to connect a Service Account from Google Drive API with pydrive. I managed to do it with auth2 client.
Luca Vlad
  • 95
  • 1
  • 8
5
votes
2 answers

PyDrive download file from a SHARED drive

I know how to use PyDrive to download a file from my drive, the problem is that I need to download (or at the very least OPEN) an xlsx file on a shared drive. Here is my code so far to download the file: from pydrive.auth import GoogleAuth from…
Berti1989
  • 185
  • 1
  • 14
5
votes
1 answer

Upload and convert XLSX to Google Sheets with PyDrive

I am trying to upload a .xlsx file to google drive. I am able to upload it. But when we try to open the same file in Drive, it has to be opened with Google Sheets. Thus, it creates a new file with same name and consumes Drive space. I suppose I need…
LMSharma
  • 279
  • 3
  • 10
5
votes
1 answer

Upload File to Google-drive Teamdrive folder with PyDrive

I have been successfully uploading files to a google-drive-folder with PyDrive. But, when it comes to uploading files to a folder in a google-drive-teamdrive-folder which is shared with me, the following code is not working. from pydrive.auth import…
Raad A.
  • 53
  • 1
  • 8
5
votes
4 answers

Pydrive error: No downloadLink/exportLinks for mimetype found in metadata

I am trying to download a simple text file from google drive automatically with the pydrive module for python. I keep getting the following error: Traceback (most recent call last): File "C:\GIS\AVGOPS\Scripts\GoogleDrive_Test.py", line 20, in…
AVG Woodlands
  • 61
  • 1
  • 1
  • 3
5
votes
1 answer

PyDrive: Create a Google Doc file

I am using PyDrive to create files in Google Drive, but I'm having trouble with the actual Google Doc type items. My code is: file = drive.CreateFile({'title': pagename, "parents": [{"id": folder_id}], "mimeType":…
awestover89
  • 1,713
  • 4
  • 21
  • 37
5
votes
2 answers

User rate limit exceeded after a few requests

I am using Google Drive API through pydrive to move files between two google drive accounts. I have been testing with a folder with 16 files. My code always raises an error in the sixth file "User rate limit exceeded"> I know that there is a…
5
votes
4 answers

PyDrive client_secrets from other directory

I'm using PyDrive to upload files to GoogleDrive from a desktop Python app that I'm packaging with Pyinstaller. I'd like to hide the client_secrets.json as much as possible so I've embedded it within the Pyinstaller .exe file, using this solution:…
user2509710
  • 79
  • 1
  • 7
5
votes
1 answer

Service Account and PyDrive

I would like to use the Google Drive API to store some backups on it using a cronjob. I just don't understand how I can use PyDrive using a Service Account. When I generate the service account file, and I put it in the directory as my script as…
Depado
  • 4,811
  • 3
  • 41
  • 63
4
votes
1 answer

pydrive not accepting client_secret.json from my Google Cloud account

I have successfully used this client_secret.json to authenticate with Google API and read gSheet data, but now I am trying to upload a file to Drive using pydrive. from pydrive.auth import GoogleAuth from pydrive.drive import GoogleDrive gauth =…
Joe
  • 3,217
  • 3
  • 21
  • 37
1
2
3
17 18