Thread-safe client functionality for google-cloud-{datastore,storage}
via requests.
pip install --upgrade gcloud_requests
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")
- Install the dev deps with
pip install -r requirements-dev.txt
- then run
py.test
.
Note: This will run the tests against whatever GCP project you're currently logged into via the gcloud tool.
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!
Please read our contributor's guide.