from gcloud import datastore
dataset = datastore.get_dataset('dataset-id-here')
# Then do other things...
query = dataset.query().kind('EntityKind')
entity = dataset.entity('EntityKind')
This doesn't work, and is in both README and official docs. It is documented in help(datastore.get_dataset) but not everyone may be aware.
>>> from gcloud import datastore
>>> dataset = datastore.get_dataset('dataset-id', email, key_path)
>>> # Now you can do things with the dataset.
>>> dataset.query().kind('TestKind').fetch()
This also makes the envorinment variables optional I think, and not mandatory as per docs. It should also be documented that key_path expects the raw p12 key and not the JSON version, unlike the environment variable.
https://googlecloudplatform.github.io/gcloud-python/datastore-api.html#cloud-datastore-in-10-seconds
This doesn't work, and is in both README and official docs. It is documented in
help(datastore.get_dataset)but not everyone may be aware.This also makes the envorinment variables optional I think, and not mandatory as per docs. It should also be documented that
key_pathexpects the raw p12 key and not the JSON version, unlike the environment variable.https://googlecloudplatform.github.io/gcloud-python/datastore-api.html#cloud-datastore-in-10-seconds