【发布时间】:2017-08-04 23:47:14
【问题描述】:
我正在尝试使用 google-api-python-client https://google.github.io/google-api-python-client/docs/epy/googleapiclient.http.MediaIoBaseDownload-class.html 读取放在 Google Drive 上的大型 CSV 文件
我可以这样做下载硬盘上的文件:
request = drive_service.files().get_media(fileId=file_id)
fh = io.FileIO('test.csv', mode='w')
downloader = MediaIoBaseDownload(fh, request)
done = False
while done is False:
status, done = downloader.next_chunk()
但我想知道是否有一种简单的方法可以在内存中分块读取它。
【问题讨论】:
标签: python google-drive-api google-api-python-client