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
1
vote
0 answers

Python Google Sheets api export to pdf with 0" margin

I can effectively export to PDF from a google sheet using this code from pydrive.auth import GoogleAuth from pydrive.drive import GoogleDrive gDriveCreds="mycreds.txt" gauth = GoogleAuth() GoogleAuth.DEFAULT_SETTINGS['client_config_file'] =…
gwaldman13
  • 121
  • 1
  • 1
  • 5
1
vote
2 answers

Upload images with labels in google collab

I am using jupyter notebook in google collab. My training dataset looks like this: /data/label1/img1.jpeg . . . /data/label2/img90.jpeg I want to import such dataset. Things that I tried Step1: !pip install -U -q PyDrive %matplotlib inline import…
Paul Schimmer
  • 161
  • 3
  • 22
1
vote
2 answers

Colab how to get file id for existing file

I am starting with colab for ml and I have problem importing files from my google drive into the notebook. Say I got a file pretrained_vgg19.mat in my drive like drive/jupyter/pretrained_vgg19.mat. The code snippet for importing files from drive…
1
vote
2 answers

"UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80" while loading pickle file using pydrive on google colaboratory

I am new to using google colaboratory (colab) and pydrive along with it. I am trying to load data in 'CAS_num_strings' which was written in a pickle file in a specific directory on my google drive using colab…
1
vote
0 answers

How to get permanent public download url for a google drive file?

I'm using pydrive for a web app, where users add documents from their own drive to the app and other users can download those documents, I was able to do all authentication and get each added document file metadata At first I used downloadUrl…
Souames
  • 1,115
  • 3
  • 11
  • 22
1
vote
0 answers

How to use PyDrive Authentication with an oAuth Access Token directly?

I'm building a web app, where a user select a file from his drive using Google Picker API, but I want to get the full public link for the selected document, I already have an access token which I got on the frontend with JS and and the Google APIs,…
Souames
  • 1,115
  • 3
  • 11
  • 22
1
vote
0 answers

PyDrive create xlsx file and upload it (Python)

Sorry for my english. I try create new file in google drive(xlsx) and set someting data. But i have error: AttributeError: 'bytes' object has no attribute 'encode' my code: drive = DriveBox() # return pydrive obj df = pd.DataFrame({'a':…
r1299597
  • 609
  • 3
  • 10
  • 20
1
vote
1 answer

pydrive upload a file 400 "Bad Request"

I'm uploading a file from one GDrive account to another, using PyDrive. I can download the file fine, but then when I go to upload it, I get a 400. pydrive.files.ApiRequestError:
Adam
  • 442
  • 1
  • 6
  • 18
1
vote
1 answer

PyDrive download image python

I have mail messages which contain attachments. I need to upload the attachments from mail to google drive. For mail I'm using imaplib and for google drive I'm using pyDrive I'm using the below code to get attachment: if mail.get_content_maintype()…
r1299597
  • 609
  • 3
  • 10
  • 20
1
vote
1 answer

error in raspberry-pi oauth2client libraries

I want to upload a text file present in a folder of raspberry pi. For this I have used the following code: from pydrive.drive import GoogleDrive drive = GoogleDrive(gauth) file1 = drive.CreateFile({'title': 'Hello.txt'}) # Create GoogleDriveFile…
1
vote
0 answers

py2exe pydrive error ssl.pyc file not found

With fear and trembling I post my first question here. I have a simple program which downloads and uploads to/from google drive using pydrive calling authorizeGdrive (where it's choking now) downloadFile, uploadFile. When it builds I get a long list…
EBK
  • 11
  • 1
1
vote
1 answer

Optional query parameters with InsertPermission() in PyDrive

Is it possible to send a value for optional query parameters using InsertPermission() in PyDrive? The PyDrive documentation seems to ignore how to handle toggling optional parameters like sendNotificationEmails. I need to add permissions to files…
1
vote
2 answers

Google Drive API permissions, how to disable findable by anyone on Internet?

I search for google but get no result, my code is as follow: import sys reload(sys) sys.setdefaultencoding("utf-8") from pydrive.auth import GoogleAuth from pydrive.drive import GoogleDrive # this function used inside function…
1
vote
2 answers

Use pydrive to list files using a variable holding the folder id's, in a loop

I am using pyDrive to get a list of all files in specific folder id's. If I hard code the folder id, it works fine, but I'd like to use a loop, and cycle through a list of folder ID's. It might just be that I'm not formatting the variable into the…
Aegis
  • 13
  • 4
1
vote
2 answers

How to send a note to recipients for an uploaded file to Google Drive?

I am with pyDrive to upload files to my Google Drive. I am able to upload files to any specific folder. from pydrive.auth import GoogleAuth from pydrive.drive import GoogleDrive gauth = GoogleAuth() gauth.LocalWebserverAuth() drive =…
alextc
  • 3,206
  • 10
  • 63
  • 107