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

PyDrive Create folder in Google Drive - Error as AttributeError: 'GoogleDrive' object has no attribute 'files

Trying to create a folder in an existing folder using PyDrive based on dates but I keep on receiving the error as 'GoogleDrive' object has no attribute 'files' Documentation from pydrive.auth import GoogleAuth from pydrive.drive import…
4
votes
1 answer

Pydrive: How to upload a large file or in chunks?

I'm trying to upload a large csv compressed file (~6GB) to Google Drive via PyDrive, but everytime I try to do the upload via: file = self.drive.CreateFile({ 'title': file_name, 'parents': [{ 'id': parent_id }], 'mimeType':…
4
votes
2 answers

PyDrive 2.0 – AuthenticationError: No code found in redirect

Set-up I'm using PyDrive 2.0 to connect to the Google Drive API. def connect_google_drive_api(): import os # use Gdrive API to access Google Drive os.chdir('/Users/my/fol/ders/access_google_drive') from pydrive.auth…
LucSpan
  • 1,831
  • 6
  • 31
  • 66
4
votes
2 answers

pydrive: RedirectMissingLocation: Redirected but the response is missing a Location: header

I need to override an existing file inside a google drive folder with a new file. This is what I have. file = drive.CreateFile({'id': }) file.SetContentFile() file.Upload() print('title: %s,…
user10467920
  • 41
  • 1
  • 2
4
votes
1 answer

PyDrive Upload and Remove

I am new to Google Drive API and writing a simplest form of a script that automatically upload an image from the local drive on to google drive, then once that image is uploaded, delete the local copy, following is what I have got: #%% import…
Gary
  • 53
  • 5
4
votes
2 answers

Upload Image to Google Drive using PyDrive

I have a silly question about PyDrive. I try to make a REST API using FastAPI that will upload an Image to Google Drive using PyDrive. Here is my code: from fastapi import FastAPI, File from starlette.requests import Request from starlette.responses…
4
votes
2 answers

How can I access a Team Drive instead of personal Google Drive using PyDrive?

I am trying to use PyDrive to programmatically list and then download files stored on a Team Drive that I can access in a browser. When I do this: from pydrive.auth import GoogleAuth from pydrive.drive import GoogleDrive gauth = GoogleAuth() drive…
I Z
  • 5,719
  • 19
  • 53
  • 100
4
votes
2 answers

Delete files from Colaboratory without moving to Trash

I would like to immediately delete temporary files saved from a Google Colaboratory notebook without them going to the Trash. I am using Keras+Tensorflow in my script and have it save the complete model after every epoch of training. The main reason…
David L.
  • 209
  • 2
  • 11
4
votes
2 answers

upload files from kaggle to google drive

I am using kaggle to train a model and once training is done I would like upload the trained model to google drive as I cant figure out a way to download the model locally. I looked into using https://pythonhosted.org/PyDrive/ after doing pip…
0101
  • 1,036
  • 2
  • 14
  • 24
4
votes
4 answers

Error: redirect_uri_mismatch pydrive

I am trying to connect to google drive and for that I am using python pydrive library. I have followed the documentation and written a snippet for connecting with google drive. But I get an error Error: redirect_uri_mismatch The redirect URI in the…
Shahab Ali
  • 389
  • 1
  • 3
  • 23
4
votes
1 answer

Python: Copy a file in google drive into a specific folder

I'm making a spreadsheet that I need to reset every single week, I'm trying to use the PyDrive API to make a copy of the file, which works perfectly with the code below. My problem is that i cant specify which folder I want to save the copy in. I…
4
votes
2 answers

Python: Google Drive Authentification

My task is to connect to Google Drive API (with the help of PyDrive module) and download some files. I somehow managed to get this thing working on my local computer - I registered my "app" at the Google Console, I downloaded the client_secret.json,…
mLC
  • 663
  • 10
  • 22
4
votes
1 answer

Manage files from public Google Drive URL using PyDrive

I`m using PyDrive QuickStart script to list my Google Drive files. Code: from pydrive.auth import GoogleAuth from pydrive.drive import GoogleDrive gauth = GoogleAuth() gauth.LocalWebserverAuth() drive = GoogleDrive(gauth) file_list =…
Filipe Spindola
  • 1,825
  • 1
  • 15
  • 17
4
votes
1 answer

Is there any way I can make PyDrive remember authentication for a user?

I made a program using Python and PyDrive. The program captures an image and uploads it to a folder on Google Drive. This is the basic code for my authentication and upload: gauth = GoogleAuth() drive = GoogleDrive(gauth) file_image =…
Gabe
  • 624
  • 8
  • 19
4
votes
0 answers

pydrive.auth.RefreshError: No refresh_token found

I am trying to download file from google drive with pydrive. code is modified from Automating pydrive verification process And it is giving following error. $ python driveDownload.py a a.xls Google Drive Token Expired, Refreshing Traceback (most…
idom
  • 51
  • 6
1 2
3
17 18