sweeeeeet
sweeeeeet

Reputation: 1819

equivalent of python boto for google storage

I am looking for the easiest way to upload or download a file to/from a google storage bucket using a python script (.py).

For Amazon S3, there is the excellent package boto, is there something similar for Google storage?

Note that I tried the following code:

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)

And the process get stucked without an error but without listing nothing.

Upvotes: 3

Views: 1849

Answers (1)

christian.simms
christian.simms

Reputation: 906

Google wrote a plugin for boto which works with Google Cloud Storage: gcs-oauth2-boto-plugin.

And Google wrote a page on how to use that plugin.

Upvotes: 4

Related Questions