iterative / PyDrive2

Google Drive API Python wrapper library. Maintained fork of PyDrive.
https://docs.iterative.ai/PyDrive2
Other
581 stars 69 forks source link

Add the endpoint export #189

Open edd34 opened 2 years ago

edd34 commented 2 years ago

The endpoint GET https://www.googleapis.com/drive/v2/files/:fileId/export seems to be missing

https://developers.google.com/drive/api/v2/reference/files/export

It's a feature that allow you to download a HTML with CSS inlined version of a doc.

edd34 commented 2 years ago

I have found a solution here :

from pydrive2.drive import GoogleDriveFile
GoogleDriveFile myfile = GoogleDriveFile() # here an instance of GoogleDriveFile
myfile.metadata.get("exportLinks").get("text/html").text

This code snippet, gives you link of a html/css page you can download as a text file.