Skip to main content

Python Client for Google Cloud Storage

Project description

Python idiomatic client for Google Cloud Storage

pypi versions

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.21.0.tar.gz (51.0 kB view details)

Uploaded Source

Built Distribution

google_cloud_storage-0.21.0-py2.py3-none-any.whl (64.7 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

File hashes

Hashes for google-cloud-storage-0.21.0.tar.gz
Algorithm Hash digest
SHA256 6a665ed1c4ed15c9d8c974372848cd0d8968be7eef0f764cb73c2d41b7c2bc91
MD5 d5a845428c5c0501e27296ff5f56b733
BLAKE2b-256 34b64b1ce5bc352502bf3132b683bfe8c269fbc3bfe938b12358dcf9a6fa6d62

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for google_cloud_storage-0.21.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 cf452147b39cecf9e57c154b520a2328971d65996cad9a633a3db5afdad5b0ca
MD5 875d204d12d670d4d18ef0f4af3fbebf
BLAKE2b-256 c4eddc78ac4426e1135f06331663198e3b75a4699068bd601bb3f15534c77147

See more details on using hashes here.

Provenance

Supported by

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