[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["Version latestkeyboard_arrow_down\n\n- [2.21.0 (latest)](/python/docs/reference/datastore/latest/helpers)\n- [2.20.2](/python/docs/reference/datastore/2.20.2/helpers)\n- [2.19.0](/python/docs/reference/datastore/2.19.0/helpers)\n- [2.18.0](/python/docs/reference/datastore/2.18.0/helpers)\n- [2.17.0](/python/docs/reference/datastore/2.17.0/helpers)\n- [2.16.1](/python/docs/reference/datastore/2.16.1/helpers)\n- [2.15.2](/python/docs/reference/datastore/2.15.2/helpers)\n- [2.14.0](/python/docs/reference/datastore/2.14.0/helpers)\n- [2.13.2](/python/docs/reference/datastore/2.13.2/helpers)\n- [2.12.0](/python/docs/reference/datastore/2.12.0/helpers)\n- [2.11.1](/python/docs/reference/datastore/2.11.1/helpers)\n- [2.10.0](/python/docs/reference/datastore/2.10.0/helpers)\n- [2.9.0](/python/docs/reference/datastore/2.9.0/helpers)\n- [2.8.3](/python/docs/reference/datastore/2.8.3/helpers)\n- [2.7.2](/python/docs/reference/datastore/2.7.2/helpers)\n- [2.6.2](/python/docs/reference/datastore/2.6.2/helpers)\n- [2.5.1](/python/docs/reference/datastore/2.5.1/helpers)\n- [2.4.0](/python/docs/reference/datastore/2.4.0/helpers)\n- [2.3.0](/python/docs/reference/datastore/2.3.0/helpers)\n- [2.2.0](/python/docs/reference/datastore/2.2.0/helpers)\n- [2.1.6](/python/docs/reference/datastore/2.1.6/helpers)\n- [2.0.1](/python/docs/reference/datastore/2.0.1/helpers)\n- [1.15.5](/python/docs/reference/datastore/1.15.5/helpers)\n- [1.14.0](/python/docs/reference/datastore/1.14.0/helpers)\n- [1.13.2](/python/docs/reference/datastore/1.13.2/helpers)\n- [1.12.0](/python/docs/reference/datastore/1.12.0/helpers)\n- [1.11.0](/python/docs/reference/datastore/1.11.0/helpers)\n- [1.10.0](/python/docs/reference/datastore/1.10.0/helpers)\n- [1.9.0](/python/docs/reference/datastore/1.9.0/helpers) \n\nHelpers\n=======\n\nHelper functions for dealing with Cloud Datastore's Protobuf API.\n\nThe non-private functions are part of the API.\n\n### *class* google.cloud.datastore.helpers.GeoPoint(latitude, longitude)\n\nBases: [`object`](https://docs.python.org/3/library/functions.html#object)\n\nSimple container for a geo point value.\n\n- **Parameters**\n\n - **latitude** ([*float*](https://docs.python.org/3/library/functions.html#float)) -- Latitude of a point.\n\n - **longitude** ([*float*](https://docs.python.org/3/library/functions.html#float)) -- Longitude of a point.\n\n#### _*eq_*(other)\n\nCompare two geo points for equality.\n\n- **Return type**\n\n [bool](https://docs.python.org/3/library/functions.html#bool)\n- **Returns**\n\n True if the points compare equal, else False.\n\n#### _*ne_*(other)\n\nCompare two geo points for inequality.\n\n- **Return type**\n\n [bool](https://docs.python.org/3/library/functions.html#bool)\n- **Returns**\n\n False if the points compare equal, else True.\n\n#### to_protobuf()\n\nConvert the current object to protobuf.\n\n- **Return type**\n\n `google.type.latlng_pb2.LatLng`.\n- **Returns**\n\n The current point as a protobuf.\n\n### google.cloud.datastore.helpers.entity_from_protobuf(pb)\n\nFactory method for creating an entity based on a protobuf.\n\nThe protobuf should be one returned from the Cloud Datastore\nProtobuf API.\n\n- **Parameters**\n\n **pb** (`entity_pb2.Entity`) -- The Protobuf representing the entity.\n- **Return type**\n\n [`google.cloud.datastore.entity.Entity`](/python/docs/reference/datastore/latest/entities#google.cloud.datastore.entity.Entity)\n- **Returns**\n\n The entity derived from the protobuf.\n\n### google.cloud.datastore.helpers.entity_to_protobuf(entity)\n\nConverts an entity into a protobuf.\n\n- **Parameters**\n\n **entity** ([`google.cloud.datastore.entity.Entity`](/python/docs/reference/datastore/latest/entities#google.cloud.datastore.entity.Entity)) -- The entity to be turned into a protobuf.\n- **Return type**\n\n `entity_pb2.Entity`\n- **Returns**\n\n The protobuf representing the entity.\n\n### google.cloud.datastore.helpers.get_read_options(eventual, transaction_id, read_time=None, new_transaction_options=None)\n\nValidate rules for read options, and assign to the request.\n\nHelper method for `lookup()` and `run_query`.\n\n- **Parameters**\n\n - **eventual** ([*bool*](https://docs.python.org/3/library/functions.html#bool)) -- Flag indicating if `EVENTUAL` or `STRONG`\n consistency should be used.\n\n - **transaction_id** ([*bytes*](https://docs.python.org/3/library/stdtypes.html#bytes)) -- A transaction identifier (may be null).\n\n - **read_time** (*datetime*) -- Read data from the specified time (may be null). This feature is in private preview.\n\n - **new_transaction_options** (`google.cloud.datastore_v1.types.TransactionOptions`) -- Options for a new transaction.\n\n- **Return type**\n\n `datastore_pb2.ReadOptions`\n- **Returns**\n\n The read options corresponding to the inputs.\n- **Raises**\n\n [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError) if more than one of `eventual==True`,\n `transaction_id`, `read_time`, and `new_transaction_options` is specified.\n\n### google.cloud.datastore.helpers.get_transaction_options(transaction)\n\nGet the transaction_id or new_transaction_options field from an active transaction object,\nfor use in get_read_options\n\nThese are mutually-exclusive fields, so one or both will be None.\n\n- **Return type**\n\n Tuple\\[Optional\\[[bytes](https://docs.python.org/3/library/stdtypes.html#bytes)\\], Optional\\[google.cloud.datastore_v1.types.TransactionOptions\\]\\]\n- **Returns**\n\n The transaction_id and new_transaction_options fields from the transaction object.\n\n### google.cloud.datastore.helpers.key_from_protobuf(pb)\n\nFactory method for creating a key based on a protobuf.\n\nThe protobuf should be one returned from the Cloud Datastore\nProtobuf API.\n\n- **Parameters**\n\n **pb** (`entity_pb2.Key`) -- The Protobuf representing the key.\n- **Return type**\n\n [`google.cloud.datastore.key.Key`](/python/docs/reference/datastore/latest/keys#google.cloud.datastore.key.Key)\n- **Returns**\n\n a new Key instance\n\n### google.cloud.datastore.helpers.set_database_id_to_request(request, database_id=None)\n\nSet the \"database_id\" field to the request only if it was provided."]]