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
0
votes
1 answer

How to download file from google drive folder?

I have a script that gets a list of files from google drive from pydrive.drive import GoogleDrive gauth = GoogleAuth() gauth.LoadCredentialsFile("mycreds.txt") gauth.LoadCredentialsFile("mycreds.txt") if gauth.credentials is None: …
auem
  • 45
  • 7
0
votes
1 answer

How to auth google drive account on a remote server using python

I have a server and i want to provide users an option to upload files to Google Drive. I tried with using pydrive, my code is the following: from pydrive.auth import GoogleAuth from pydrive.drive import GoogleDrive gauth =…
Dioswison
  • 81
  • 9
0
votes
1 answer

Why is GoogleAuth failing to refresh in my webapp?

I am testing using PyDrive in my web app and the refresh part causes it to return a 500 error. Sometimes it works after awhile but I'm not sure what the conditions are. The same code works locally always. Any idea what could be the issue? from…
Anthony M
  • 109
  • 8
0
votes
1 answer

PyDrive: How to give multiple users permission

I have been using PyDrive2 to upload files on google drive. I use the following snippet. new_permission = { 'emailAddress': EMAIL, 'role': 'reader', 'type': 'user', 'value': EMAIL } …
0
votes
1 answer

Pydrive create folder + upload file

I would like to create a folder on Google drive and then upload files to Google drive using Pydrive My codes are working separately, but I would like to do it in 1 step. Code to create folder gauth = GoogleAuth() drive =…
Singh
  • 80
  • 7
0
votes
0 answers

How can I upload a file on Google Drive with Python using PyDrive without a browser page opening?

I have this example where I upload a csv file in my Google Drive, but a browser page is opened, and I don't want it. In addition to this, I created a project in Google Cloud where I enabled Google Drive API, generated a OAuth 2.0 client ID and added…
0
votes
0 answers

Attached a file from drive to an email

I want to send file to a list of email, but i don't know how to attached a fill from drive, i know the id of my pdf but it doesn't work. import smtplib, ssl from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from…
Alexia
  • 19
  • 3
0
votes
0 answers

How to find file excluded trash file in team drive?

I have a difficulty to find a file in my team drive because i also have file from trash. There is my current code : filename = 'name' file_list = drive.ListFile({ 'q':f"title contains '${filename}' and mimeType='application/pdf'", …
Alexia
  • 19
  • 3
0
votes
0 answers

Anyone know how to fix the new OAuth2 error when trying to authenticate a PyDrive application?

I don't think this issue is specific to PyDrive, but rather Google OAuth. However, some of the solutions I've seen on stackoverflow don't seem to be transferable over to my PyDrive application, which is just a python script to upload files…
user16545584
0
votes
1 answer

Using Pydrive for automatic uploading

I am using Pydrive module for uploading files to my google drive. The code which I am using: from pydrive.auth import GoogleAuth from pydrive.drive import GoogleDrive gauth = GoogleAuth() gauth.LocalWebserverAuth() drive =…
Meet Gondaliya
  • 387
  • 4
  • 18
0
votes
1 answer

Google Data Studio and Modifying Google Sheets

I'm currently using PyDrive to automatically modify existing Google Sheets I have uploaded to my Google Drive. I then have Google Data Studio connecting to these Google Sheets so that I can then visualize them. The only problem is that when I modify…
0
votes
1 answer

PyDrive: Generating a sharable link to a file immediately after upload?

I am testing my script that uses PyDrive to upload to a folder inside a shared drive. As it is, the files upload with no problem, however, the sharable link doesn't work. My program hits my exception block by then. I don't receive any errors. file1…
user16545584
0
votes
1 answer

PyDrive and Files Not Found

So I've noticed that PyDrive isn't able to find any files that weren't originally uploaded by PyDrive. Using myfilelist = drive.ListFile({'q': "'id' in parents and trashed=false"}).GetList() it returns blank - but if I upload the file using PyDrive…
Anonymous
  • 37
  • 5
0
votes
1 answer

Changing filename when uploading a file to GoogleDrive by using pydrive

I want to add time string to the end of filenames which I am uploading to Google Drive by using pydrive. Basically I try to code below, but I have no idea how to adapt new file variable: import time from pydrive.auth import GoogleAuth from…
0
votes
1 answer

Is there any way that i can read multiple different file type like xlsv, csv, xls in Google drive using pydrive?

So I want to create a condition that allows me to read two or more file types in google drive using pydrive. But I don't know where to start. and I do have this code. gauth = GoogleAuth() gauth.LocalWebserverAuth() spreadsheet_id = '######' …
Jore Dawal
  • 59
  • 1
  • 10