0

I use pyDrive as a communication tool of my classic Python-based GIS and Google Earth Engine (GEE). Therefore, I need to transfer data from Google Drive to my local machine, but I face some problems:

The upload of data works, and I can see uploaded data in a Drive.ListFile command, but I can't neither enter folders by using their ID nor find any folders via listFile.

listfile = drive.ListFile({'q': "'root' in parents and trashed=false"}).GetList()

Upload and Download of test data works like a charm, but the folders drive me crazy! Is there some kind of refresh of the Drive needed?

Benjamin Mewes
  • 89
  • 2
  • 10

1 Answers1

1

If you want to include folders in you Files.list call use the query

mimeType = 'application/vnd.google-apps.folder'

Also don't forget to specify your field parameters.

ReyAnthonyRenacia
  • 17,219
  • 5
  • 37
  • 56
  • Not sure if the API or documentation has changed since this answer was written, but it currently says you should get both files and folders if you don't specify a mimeType. The documentation says to specify that mimeType to return _only_ folders. – benrifkah Jun 05 '23 at 23:32