gcloud_requests

Thread-safe client functionality for gcloud-python via requests.


License
MIT
Install
pip install gcloud_requests==2.0.4

Documentation

gcloud_requests

GitHub license PyPI Version Build Status Code Climate

Thread-safe client functionality for google-cloud-{datastore,storage} via requests.

Installation

pip install --upgrade gcloud_requests

Usage

Google Cloud Datastore:

from google.cloud import datastore
from gcloud_requests import DatastoreRequestsProxy

client = datastore.Client(_http=DatastoreRequestsProxy(), _use_grpc=False)
client.query(kind="EntityKind").fetch()

Google Cloud Storage:

from google.cloud import storage
from gcloud_requests import CloudStorageRequestsProxy

proxy = CloudStorageRequestsProxy()
client = storage.Client(credentials=proxy.credentials, _http=proxy)
bucket = client.get_bucket("my-bucket")

Running Tests

  1. Install the dev deps with pip install -r requirements-dev.txt
  2. then run py.test.

Note: This will run the tests against whatever GCP project you're currently logged into via the gcloud tool.

Authors

gcloud_requests was authored at Leadpages. You can find out more about contributors here. We welcome contributions, and we're always looking for more engineering talent!

Contributing

Please read our contributor's guide.