Google Cloud Storage API client library
Project description
Python idiomatic client for Google Cloud Storage
Quick Start
$ pip install --upgrade google-cloud-storage
For more information on setting up your Python development environment, such as installing pip and virtualenv on your system, please refer to Python Development Environment Setup Guide for Google Cloud Platform.
Authentication
With google-cloud-python we try to make authentication as painless as possible. Check out the Authentication section in our documentation to learn more. You may also find the authentication document shared by all the google-cloud-* libraries to be helpful.
Using the API
Google Cloud Storage (Storage API docs) allows you to store data on Google infrastructure with very high reliability, performance and availability, and can be used to distribute large data objects to users via direct download.
See the google-cloud-python API storage documentation to learn how to connect to Cloud Storage using this Client Library.
You need to create a Google Cloud Storage bucket to use this client library. Follow along with the official Google Cloud Storage documentation to learn how to create a bucket.
from google.cloud import storage
client = storage.Client()
# https://console.cloud.google.com/storage/browser/[bucket-id]/
bucket = client.get_bucket('bucket-id-here')
# Then do other things...
blob = bucket.get_blob('remote/path/to/file.txt')
print(blob.download_as_string())
blob.upload_from_string('New contents!')
blob2 = bucket.blob('remote/path/storage.txt')
blob2.upload_from_filename(filename='/local/path.txt')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for google-cloud-storage-1.10.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1969558df8d7994cf4f89f60c01c619d77fc19facb38f66640d1f749a663e2e |
|
MD5 | c10073a1bb4e19c44d8eebc82de1add8 |
|
BLAKE2b-256 | 62731ea71c8b319064bc6ae0530cb0f78fe15987c7881f132938e3fa83ddff46 |
Hashes for google_cloud_storage-1.10.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e53ee063e5075dc69322162fdf7e1b2a51eac82ec0449293e471fa8f36cdeba |
|
MD5 | 80fa26559ba63ece12bbe708c8c2fe79 |
|
BLAKE2b-256 | d41a8238dda1547b9b6156f4cfc7923558bb67d6c608a28d677d0dc070babd31 |