Google Drive Integration Module
Google Drive integration for DRIADA.
This module provides utilities for uploading and downloading data to/from Google Drive, particularly useful for sharing experimental data and results.
Utilities for uploading and downloading data to/from Google Drive, particularly useful for sharing experimental data and results.
Module Components
Quick Links
- Authentication
desktop_auth()- Authenticate on desktopgoogle_colab_auth()- Authenticate in ColabAuthentication - Authentication utilities
- Download Functions
download_gdrive_data()- Download files/foldersdownload_part_of_folder()- Selective downloadinitialize_iabs_router()- Setup IABS routerDownload Functions - All download utilities
- Upload Functions
save_file_to_gdrive()- Upload filesUpload Functions - Upload utilities
- Utilities
GoogleDriveFile- File wrapper classparse_google_drive_file()- Parse Drive filesid_from_link()- Extract ID from URLUtility Functions - General utilities
Usage Example
from driada.gdrive import (
desktop_auth,
download_gdrive_data,
save_file_to_gdrive
)
# Authenticate
auth = desktop_auth('path/to/client_secrets.json')
# Download data
success, log = download_gdrive_data(
auth,
'https://drive.google.com/file/d/...',
'local_path/'
)
# Upload results
file_id = save_file_to_gdrive(
auth,
'results.h5',
folder_id='...'
)