I’m working on auto-archiver which is written in Python.

Currently the cloud storage used is Digital Ocean Spaces. I’m putting in a feature flag to use Google Drive instead.

Secrets are held in the .env file

They use Google Speadsheets already in the application which necessitates Google Drive API access . See 1. Getting API access to the sheet

Google Drive using Service Account



alt text

Share a folder with the service account eg autoarchiverservice@auto-archiver-xxxxx.iam.gserviceaccount.com

This allows me to read and write to the shared folder on the google drive account (in the is case it is my personal google drive) from the service account.

ie I can see a shared folder_id I can then write inside that folder.



https://github.com/googleworkspace/python-samples/blob/master/drive/quickstart/quickstart.py Samples

Uploading a file

https://github.com/iterative/PyDrive2 - could use this.

https://developers.google.com/drive/api/guides/search-files API docs


Appendix - Google Console

https://console.cloud.google.com/ - where you allow access

https://admin.google.com/ is used for Google Workspace accounts only

Appendix - Google Drive Desktop

Using Google Drive Desktop you can view all your files as a linked drive G: in Windows Explorer.