python - 相当于用于谷歌存储的 python boto

标签 python amazon-s3 google-cloud-storage boto

我正在寻找使用 python 脚本 (.py) 将文件上传到谷歌存储桶或从中下载文件的最简单方法。

对于 Amazon S3,有优秀的包 boto,Google 存储有类似的东西吗?

请注意,我尝试了以下代码:

from boto import connect_gs      

gs_conn = connect_gs(gs_access_key_id='xxxxxxxxxxxxxxxxxxxxxxxxx',
                     gs_secret_access_key='xxxxxxxxxxxxxxxxxxxxxxxxxxx')
bucket = gs_conn.get_bucket('gs://xxxxxxxxxxxxxxxxx')
keys = bucket.get_all_keys()
for key in keys:
    print(key)

过程卡住了,没有错误,但没有列出任何内容。

最佳答案

Google 为 boto 编写了一个与 Google Cloud Storage 配合使用的插件:gcs-oauth2-boto-plugin .

Google 写了一个 page关于如何使用该插件。

关于python - 相当于用于谷歌存储的 python boto,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33467207/

相关文章:

python - 有人可以给我一个关于 WSGI 幕后细节与 Python 的其他 Web 界面方法的高级技术概述吗?

python - 如何使用 EC2 实例 (GPU) 在 S3 中为深度学习模型加载图像

node.js - 如何在云存储node.js客户端中从url上传文件

json - 获取 400 错误请求原因 :required from google cloud stoarge json api

python - 实现由 GCS 触发的云功能以发布到 pubsub

python - Flask 找不到应用程序文件

Python - 判断pandas数据框中是否存在非连续日期

c++ - 将 numpy 的数组 reshape 转换为等效的 OpenCV

amazon-web-services - 如何在 S3 加密中启用 AWS 托管 key (aws/s3) 作为 AWS KMS key

amazon-web-services - Amazon S3 是否有文件大小限制