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

Fore more information on setting up your Python development environment, such as installing pip and 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

google-cloud-storage-1.6.0.tar.gz (5.4 MB 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-1.6.0-py2.py3-none-any.whl (51.5 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

File hashes

Hashes for google-cloud-storage-1.6.0.tar.gz
Algorithm Hash digest
SHA256 939266b7d5c6df6d45a1aee2c47a09313f813e87790335f00c57708b49480054
MD5 537a2aa36761c9213366b74b4124b0a4
BLAKE2b-256 7560b7e6a527523cf9d16f8ce09dee3e79fe873184481b2889ce85256e0dff97

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for google_cloud_storage-1.6.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5db85fa905f85377c5ea9ea0fb4c5602343d2ecc09395aa2efbf9a21d27233fc
MD5 3886ca698189111422ef3dbd6b2317a7
BLAKE2b-256 c813131c4d6b72411bcd56ab82a70a256d961e8d87e7b6356c12791c0003765d

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