import json, os from google.oauth2.credentials import Credentials from googleapiclient.discovery import build ROOT_FOLDER_ID = '1BUtCsz-SfdDCYspmwQlvSiyffFP2TFfY' # Class Materials folder token_file = os.path.expanduser('~/.hermes/google_token.json') with open(token_file, 'r') as f: creds = Credentials.from_authorized_user_info(json.load(f)) service = build('drive', 'v3', credentials=creds) results = service.files().list( q=f"'{ROOT_FOLDER_ID}' in parents and trashed = false", fields="files(id, name, mimeType)" ).execute().get('files', []) for f in results: print(f"{f['name']} ({f['mimeType']}) -> id: {f['id']}")