Skip to main content

API Client library for Google Cloud

Project description

Python idiomatic client for Google Cloud Platform services.

pypi build coverage

This client supports the following Google Cloud Platform services:

If you need support for other Google APIs, check out the Google APIs Python Client library.


$ pip install gcloud

Example Applications

Google Cloud Datastore

Google Cloud Datastore is a fully managed, schemaless database for storing non-relational data. Cloud Datastore automatically scales with your users and supports ACID transactions, high availability of reads and writes, strong consistency for reads and ancestor queries, and eventual consistency for all other queries.

See the Google Cloud Datastore docs for more details on how to activate Cloud Datastore for your project.

See the gcloud-python API datastore documentation to learn how to interact with the Cloud Datastore using this Client Library.

from gcloud import datastore
# Create, populate and persist an entity
entity = datastore.Entity(key=datastore.Key('EntityKind'))
    'foo': u'bar',
    'baz': 1337,
    'qux': False,
# Then query for entities
query = datastore.Query(kind='EntityKind')
for result in query.fetch():
    print result

Google Cloud Storage

Google Cloud Storage 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.

You need to create a Google Cloud Storage bucket to use this client library. Follow the steps on the Google Cloud Storage docs to learn how to create a bucket.

See the gcloud-python API storage documentation to learn how to connect to Cloud Storage using this Client Library.

from gcloud import storage
bucket = storage.get_bucket('bucket-id-here', 'project-id')
# Then do other things...
blob = bucket.get_blob('/remote/path/to/file.txt')
print blob.download_as_string()
blob.upload_from_string('New contents!')
bucket.upload_file('/remote/path/storage.txt', '/local/path.txt')


Contributions to this library are always welcome and highly encouraged.

See CONTRIBUTING for more information on how to get started.

Python Versions

We support Python 2.6 and Python 2.7 and plan to support Python 3.3 and Python 3.4. For more information, see Supported Python Versions in CONTRIBUTING.


This library follows Semantic Versioning.

It is currently in major version zero (0.y.z), which means that anything may change at any time and the public API should not be considered stable.


Apache 2.0 - See LICENSE for more information.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gcloud-0.4.2.tar.gz (132.5 kB view hashes)

Uploaded Source

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