This directory contains samples for Google Cloud Storage. Google Cloud Storage provides support for S3 API users through the GCS XML API. Learn more about migrating data from S3 to GCS at https://cloud.google.com/storage/docs/migrating.
Clone python-docs-samples and change directory to the sample directory you want to use.
$ git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git
Install pip and virtualenv if you do not already have them. You may want to refer to the Python Development Environment Setup Guide for Google Cloud Platform for instructions.
Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+.
$ virtualenv env $ source env/bin/activate
Install the dependencies needed to run the samples.
$ pip install -r requirements.txt
To run this sample:
$ python list_gcs_buckets.py
usage: list_gcs_buckets.py [-h] google_access_key_id google_access_key_secret
positional arguments:
google_access_key_id Your Cloud Storage HMAC Access Key ID.
google_access_key_secret
Your Cloud Storage HMAC Access Key Secret.
optional arguments:
-h, --help show this help message and exit
To run this sample:
$ python list_gcs_objects.py
usage: list_gcs_objects.py [-h]
google_access_key_id google_access_key_secret
bucket_name
positional arguments:
google_access_key_id Your Cloud Storage HMAC Access Key ID.
google_access_key_secret
Your Cloud Storage HMAC Access Key Secret.
bucket_name Your Cloud Storage bucket name
optional arguments:
-h, --help show this help message and exit