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
107
votes
15 answers

Python: download files from google drive using url

I am trying to download files from google drive and all I have is the drive's URL. I have read about google API that talks about some drive_service and MedioIO, which also requires some credentials( mainly JSON file/OAuth). But I am unable to get…
rkatkam
  • 2,634
  • 3
  • 18
  • 29
83
votes
6 answers

Automating pydrive verification process

I am trying to automate the GoogleAuth process when using the pydrive library (https://pypi.python.org/pypi/PyDrive). I've set up the pydrive and the google API such that my secret_client.json works but it requires web authentication for gdrive…
alvas
  • 115,346
  • 109
  • 446
  • 738
19
votes
4 answers

List of file in a folder/ DRIVE API PyDRIVE

I can't change folder and view what's inside. drive = GoogleDrive(gauth) file_list = drive.ListFile({'q': "'root' in parents and trashed=false"}).GetList() for file1 in file_list: print("File %s\n\n",(file1)) I used the following code: file_list =…
simone989
  • 397
  • 1
  • 3
  • 8
16
votes
1 answer

Google pydrive uploading a file to specific folder

I am trying to upload a file to my Google drive, the code below works. How can I specify to which folder to upload to i.e drive---shared with me--csvFolder from pydrive.auth import GoogleAuth from pydrive.drive import GoogleDrive gauth =…
programmerwiz32
  • 529
  • 1
  • 5
  • 20
16
votes
3 answers

Create a folder (if not exists) on google drive and upload a file to it using Python script

So far I can upload file to the folder if it exists. I can't figure out a way to create one though. So if the folder does not exist, my script dies. import sys from pydrive.auth import GoogleAuth from pydrive.drive import GoogleDrive gpath =…
Akshay Kalghatgi
  • 423
  • 1
  • 4
  • 11
12
votes
5 answers

Load xlsx file from drive in colaboratory

How can I import MS-excel(.xlsx) file from google drive into colaboratory? excel_file = drive.CreateFile({'id':'some id'}) does work(drive is a pydrive.drive.GoogleDrive object). But, print excel_file.FetchContent() returns None.…
dd_rookie
  • 331
  • 2
  • 3
  • 13
12
votes
1 answer

How to upload files to another user's Google Drive without asking permission every time?

Is there any way to upload files to another user's Google Drive without asking for login or verification code each time except the first time? Until now I used pydrive, but it asks to login each time. Is there anyway other than this, such that a key…
Jerin A Mathews
  • 8,572
  • 4
  • 26
  • 49
12
votes
8 answers

PyDrive: Invalid client secrets file

I am trying to use PyDrive to get a list of all files in my Google Drive. I have read through the docs and completed all steps. I have client secrets.json saved down, but I continue to get the following error. The code I am using is: from…
Trying_hard
  • 8,931
  • 29
  • 62
  • 85
11
votes
2 answers

python + google drive: upload xlsx, convert to google sheet, get sharable link

The flow of my desired program is: Upload an xlsx spreadsheet to drive (it was created using pandas to_excel) Convert it to Google Sheets format Specify that it is editable by anyone with the link Get the link and share it with someone who will…
djsensei
  • 193
  • 1
  • 2
  • 9
10
votes
2 answers

Python : upload my own files into my drive using Pydrive library

I want to upload my file into my drive. However in Pydrive Documentation I found only upload() function that uploads a file created by drive.CreateFile() function and update it, and not the file in my hard drive (my own file). file1 =…
Elroum
  • 327
  • 1
  • 3
  • 18
8
votes
1 answer

Pydrive google drive automate authentication

I have the following piece of code: from pydrive.auth import GoogleAuth gauth = GoogleAuth() gauth.DEFAULT_SETTINGS = {'save_credentials': True,'client_config_backend': 'settings', 'oauth_scope':…
8
votes
1 answer

Pydrive deleting file from Google Drive

I´m writing a small script in python 3.5.2 with pydrive 1.2.1 and I need to be able to delete a file which is not stored locally in my computer, but in my account of Google Drive. The docs only show how to delete a file you previously created, not…
TobiasP
  • 183
  • 2
  • 12
7
votes
1 answer

Downloading all of the files in a specific folder with PyDrive

My Google Drive looks something like this: picture1.jpg song1.mp3 a/b/file1.txt a/b/file2.txt a/b/file3.jpg a/b/file4.m4a a/b/... I want to use PyDrive to download every file in folder "b". After looking at the documentation and checking…
James Shapiro
  • 4,805
  • 3
  • 31
  • 46
6
votes
1 answer

Downloading files from public Google Drive in python: scoping issues?

Using my answer to my question on how to download files from a public Google drive I managed in the past to download images using their IDs from a python script and Google API v3 from a public drive using the following bock of code: from…
6
votes
1 answer

Pydrive: Preventing Google Drive Authorization from expiring.

In a Google Colab notebook, I am running a block of code which will take several hours to complete, and at the end a file will be uploaded to my Google drive. The issue is that sometimes my credentials will expire before the code can upload the…
SantoshGupta7
  • 5,607
  • 14
  • 58
  • 116
1
2 3
17 18