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
2
votes
0 answers

Google Drive The user has exceeded their Drive storage quota

I have created a Google Service account and I use it with Python using the Pydrive2 library. From my Python script I upload folders and files on a specific folder in the drive. The folder in the drive is owned by a Standard Account but the content…
2
votes
2 answers

How to skip folder creation if the folder already exists in google drive? (PyDrive)

def CreateGDriveFolder(self): today = str(date.today()) print("Todays Date: " + today) gauth = GoogleAuth() self.drive = GoogleDrive(gauth) folder_name = today folder =…
Dilshan
  • 187
  • 6
2
votes
2 answers

Google spreadsheet to Pandas dataframe via Pydrive without download

How do I read the content of a Google spreadsheet into a Pandas dataframe without downloading the file? I think gspread or df2gspread may be good shots, but I've been working with pydrive so far and got close to the solution. With Pydrive I managed…
DavideL
  • 294
  • 1
  • 3
  • 15
2
votes
1 answer

How to create a custom authentication flow for pydrive2

Use case: User uploads file from Angular application. The server gets it through the REST API and the backend uploads it to the users google drive. I have an Angular Frontend and a flask REST API as the backend. I need to create a custom auth flow…
2
votes
1 answer

Is there a way to rename a file while uploading it to google drive using gdrive API?

I am automatically uploading a file on google drive (using google drive API). I would like to rename the file while uploading it (as its label is originally the full path directory of the file, which is pretty long). I am using this function to…
fqntom
  • 51
  • 6
2
votes
1 answer

Delete google drive files by extension with PyDrive

I'm trying to delete all files with the extension '.pdf' from a google drive folder. Everything is fine with the API authentication, I can upload the files. The problem is being the delete. Here I upload upload_file = 'Test1.pdf' gfile =…
Lino Costa
  • 67
  • 1
  • 8
2
votes
1 answer

How to download a specific sheet from Google Sheet with Pydrive in csv

if I need to download a specific google sheet with Python and pydrive I can use a simple command like this: drive.CreateFile({'id':'[sheetID]}).GetContentFile('file.csv', mimetype='text/csv') this works, but, in this case, I download in CSV only…
2
votes
0 answers

Google Authentication of Pydrive from server

I have this python code snippet to upload file to google drive. from pydrive.auth import GoogleAuth from pydrive.drive import GoogleDrive import os g_login = GoogleAuth() g_login.LocalWebserverAuth() drive = GoogleDrive(g_login) with…
Karanam Krishna
  • 365
  • 2
  • 16
2
votes
2 answers

pydrive.auth.RefreshError: Access token refresh failed: invalid_grant: Token has been expired or revoked

so I was building a project which included me saving some in google drive and this is part of the code I used gauth = GoogleAuth() gauth.LoadCredentialsFile("mycreds.txt") if gauth.credentials is None: gauth.LocalWebserverAuth() elif…
amrha
  • 47
  • 1
  • 9
2
votes
1 answer

How to link a Google Form to a Google Sheet using Python?

Here's my setup and what I want to accomplish: I currently have a Google Form set up for users to submit information, which is then logged in a Google Sheet. I then, use PyDrive to save the contents of the Google Sheet as a csv. Pandas then reads…
james
  • 343
  • 1
  • 2
  • 10
2
votes
1 answer

Specify file download location using PyDrive?

I'm currently trying to download a file from Google Drive using PyDrive, but am only able to download the file to the same location as my Python program. Is there a way to specify the file's download location? This is how I am downloading files…
ancient
  • 23
  • 3
2
votes
1 answer

what client_secret.json file is it required for google drive files access

I am getting this error: File "/usr/local/lib/python3.7/site-packages/pydrive/auth.py", line 388, in LoadClientConfigFile raise InvalidConfigError('Invalid client secrets file %s' % error) pydrive.settings.InvalidConfigError: Invalid client…
Ciasto piekarz
  • 7,853
  • 18
  • 101
  • 197
2
votes
1 answer

PyDrive How to Download a Folder using ID

I am trying to download a file or folder from My Google drive using PyDrive After multiple attempts using the Documents : https://gsuitedevs.github.io/PyDrive/docs/build/html/filemanagement.html#download-file-conte I still cannot seem to get my head…
moe.Patel
  • 63
  • 1
  • 2
  • 9
2
votes
0 answers

Is there any way to use .gdoc (google doc files) in pydrive?

I've been attempting for a while now to get pydrive to accept my google doc files now. I've tried to find ways to convert .gdoc's to .docx's so I can use the python-docx package to read them, since all the packages I have found have been really…
Exinr
  • 21
  • 2
2
votes
1 answer

Google docs formatting, converting texts into sheets

I've had success in sending a google docs file into a google sheets and the spreadsheet managed to fill itself in correctly (it formats the text into a table, very neat) Below is an example of how I'm formatting my text: ID, NAME, MOBILE, CITY,…
user12725052