Skip to main content

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

google-cloud-storage-0.20.0.tar.gz (48.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

google_cloud_storage-0.20.0-py2.py3-none-any.whl (62.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file google-cloud-storage-0.20.0.tar.gz.

File metadata

File hashes

Hashes for google-cloud-storage-0.20.0.tar.gz
Algorithm Hash digest
SHA256 d36378c0de861073acc12afde625f5f0bf790d1ceae176a331f713d3d388100d
MD5 4bf1ef92549fe1a6a47870972dd8d910
BLAKE2b-256 1344f87a8ed0acb5e348bbeb49e0ea7ee08776e89b3cb430ace2ccd2e4cd5bfd

See more details on using hashes here.

File details

Details for the file google_cloud_storage-0.20.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for google_cloud_storage-0.20.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 fd0d6150e6c8435f520cd56d9605d23f7414d0d1ef8d937e67bde33e38d530ea
MD5 38f5718b19a5677352321e1a32dc3006
BLAKE2b-256 132b334efe08b147ec09b1494ff61fe6178426ebd0e949d511460dd7b988b505

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page