Skip to main content

API Client library for Google Cloud

Project description

Python idiomatic client for Google Cloud Platform services.

pypi build coverage versions

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.

Quick Start

$ pip install --upgrade gcloud

Example Applications

  • getting-started-python - A sample and tutorial that demonstrates how to build a complete web application using Cloud Datastore, Cloud Storage, and Cloud Pub/Sub and deploy it to Google App Engine or Google Compute Engine.

  • gcloud-python-expenses-demo - A sample expenses demo using Cloud Datastore and Cloud Storage

Authentication

With gcloud-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 gcloud-* libraries to be helpful.

Google Cloud Datastore

Google Cloud Datastore (Datastore API docs) 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 gcloud-python API datastore documentation to learn how to interact with the Cloud Datastore using this Client Library.

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

from gcloud import datastore
# Create, populate and persist an entity
entity = datastore.Entity(key=datastore.Key('EntityKind'))
entity.update({
    '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 (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 gcloud-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 gcloud 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')

Google Cloud Pub/Sub

Google Cloud Pub/Sub (Pub/Sub API docs) is designed to provide reliable, many-to-many, asynchronous messaging between applications. Publisher applications can send messages to a topic and other applications can subscribe to that topic to receive the messages. By decoupling senders and receivers, Google Cloud Pub/Sub allows developers to communicate between independently written applications.

See the gcloud-python API Pub/Sub documentation to learn how to connect to Cloud Pub/Sub using this Client Library.

To get started with this API, you’ll need to create

from gcloud import pubsub

client = pubsub.Client()
topic = client.topic('topic_name')
topic.create()

topic.publish('this is the message_payload',
              attr1='value1', attr2='value2')

Google BigQuery

Querying massive datasets can be time consuming and expensive without the right hardware and infrastructure. Google BigQuery (BigQuery API docs) solves this problem by enabling super-fast, SQL-like queries against append-only tables, using the processing power of Google’s infrastructure.

This package is still being implemented, but it is almost complete!

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

Google Cloud Resource Manager

The Cloud Resource Manager API (Resource Manager API docs) provides methods that you can use to programmatically manage your projects in the Google Cloud Platform.

See the gcloud-python API Resource Manager documentation to learn how to manage projects using this Client Library.

Contributing

Contributions to this library are always welcome and highly encouraged.

See CONTRIBUTING for more information on how to get started.

License

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

Uploaded Source

Built Distribution

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

gcloud-0.12.1-py2.py3-none-any.whl (518.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file gcloud-0.12.1.tar.gz.

File metadata

  • Download URL: gcloud-0.12.1.tar.gz
  • Upload date:
  • Size: 365.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for gcloud-0.12.1.tar.gz
Algorithm Hash digest
SHA256 eecf72d800c3e8f426dfed76db4d64c2b7d04d4a346ac8cd798d4294e9609579
MD5 71a9eb74fe25c0c5a44733d6854c4abc
BLAKE2b-256 d2342037296d1a3bf3f0238c7fa631e1b6ff580b0453e9da466416cd04c6f1ce

See more details on using hashes here.

File details

Details for the file gcloud-0.12.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for gcloud-0.12.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 3f35010ff1a3cfbce1032de07e8a78a44658946a2c6c08b19fd12f6dad09c407
MD5 cb8030b414f35c906d5f03acc787283f
BLAKE2b-256 93ae2405bbc9825ca2a9ddd9452e34561c4e81b915d070f9b5e86c4e36945a1f

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