Python Client for Google Cloud Storage
Project description
Python idiomatic client for Google Cloud Storage
Quick Start
$ pip install --upgrade google-cloud-storage
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()
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.3.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c30734fb80af4848a2bcccce48f83a757abdeaaddecbc28d2e5d43534af3e30c |
|
MD5 | b879aa0471067e0c4bb6dd6505cd7910 |
|
BLAKE2b-256 | f1b75c0156342ef807d2ebf13c4bdc7b6f170da7f7b2032e604ed94501802a90 |
Hashes for google_cloud_storage-1.3.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 085dce4b69c6d945523fc1bca80df09147ecc3953f8e6050abede79c42c01a50 |
|
MD5 | e3a7ffdd45ef4ebf0edb3ba84bec57d3 |
|
BLAKE2b-256 | 651e893bcc6e1d76cebaf4693fb235c4c1ff14bec6a977ce135d56910669a42b |