Helpers#

Helper functions for dealing with Cloud Datastore’s Protobuf API.

The non-private functions are part of the API.

gcloud.datastore.helpers.entity_from_protobuf(pb)[source]#

Factory method for creating an entity based on a protobuf.

The protobuf should be one returned from the Cloud Datastore Protobuf API.

Parameters:pb (gcloud.datastore._generated.entity_pb2.Entity) – The Protobuf representing the entity.
Return type:gcloud.datastore.entity.Entity
Returns:The entity derived from the protobuf.
gcloud.datastore.helpers.key_from_protobuf(pb)[source]#

Factory method for creating a key based on a protobuf.

The protobuf should be one returned from the Cloud Datastore Protobuf API.

Parameters:pb (gcloud.datastore._generated.entity_pb2.Key) – The Protobuf representing the key.
Return type:gcloud.datastore.key.Key
Returns:a new Key instance