小编Jot*_*thi的帖子

有没有更快的方法将多个文件从 s3 下载到本地文件夹?

我正在尝试使用 jupyter notebook 从 s3 存储桶下载 12,000 个文件,估计在 21 小时内完成下载。这是因为每个文件一次下载一个。我们可以并行进行多次下载,以便加快进程吗?

目前,我正在使用以下代码下载所有文件

### Get unique full-resolution image basenames
images = df['full_resolution_image_basename'].unique()
print(f'No. of unique full-resolution images: {len(images)}')

### Create a folder for full-resolution images
images_dir = './images/'
os.makedirs(images_dir, exist_ok=True)

### Download images
images_str = "','".join(images)
limiting_clause = f"CONTAINS(ARRAY['{images_str}'], 
full_resolution_image_basename)"
_ = download_full_resolution_images(images_dir, 
limiting_clause=limiting_clause)
Run Code Online (Sandbox Code Playgroud)

amazon-s3 amazon-web-services boto3 jupyter-notebook python-3.6

9
推荐指数
1
解决办法
1万
查看次数