A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cloud.google.com/python/docs/reference/datastore/1.10.0/client below:

Python client library | Google Cloud

Skip to main content

Stay organized with collections Save and categorize content based on your preferences.

Datastore Client

Convenience wrapper for invoking APIs/factories w/ a project.

class google.cloud.datastore.client.Client(project=None, namespace=None, credentials=None, client_info=<google.api_core.gapic_v1.client_info.ClientInfo object>, client_options=None, _http=None, _use_grpc=None)

Bases: google.cloud.client.ClientWithProject

Convenience wrapper for invoking APIs/factories w/ a project.

>>> from google.cloud import datastore
>>> client = datastore.Client()
SCOPE(: Optional[Tuple[str, ...] = ('https://www.googleapis.com/auth/datastore', )

The scopes required for authenticating as a Cloud Datastore consumer.

allocate_ids(incomplete_key, num_ids)

Allocate a list of IDs from a partial key.

property base_url()

Getter for API base URL.

batch()

Proxy to google.cloud.datastore.batch.Batch.

property current_batch()

Currently-active batch.

property current_transaction()

Currently-active transaction.

delete(key)

Delete the key in the Cloud Datastore.

NOTE: This is just a thin wrapper over delete_multi(). The backend API does not make a distinction between a single key or multiple keys in a commit request.

delete_multi(keys)

Delete keys from the Cloud Datastore.

get(key, missing=None, deferred=None, transaction=None, eventual=False)

Retrieve an entity from a single key (if it exists).

NOTE: This is just a thin wrapper over get_multi(). The backend API does not make a distinction between a single key or multiple keys in a lookup request.

get_multi(keys, missing=None, deferred=None, transaction=None, eventual=False)

Retrieve entities, along with their attributes.

key(*path_args, **kwargs)

Proxy to google.cloud.datastore.key.Key.

Passes our project.

put(entity)

Save an entity in the Cloud Datastore.

NOTE: This is just a thin wrapper over put_multi(). The backend API does not make a distinction between a single entity or multiple entities in a commit request.

put_multi(entities)

Save entities in the Cloud Datastore.

query(**kwargs)

Proxy to google.cloud.datastore.query.Query.

Passes our project.

Using query to search a datastore:

>>> query = client.query(kind='MyKind')
>>> query.add_filter('property', '=', 'val')

Using the query iterator

>>> query_iter = query.fetch()
>>> for entity in query_iter:
...     do_something(entity)

or manually page through results

>>> query_iter = query.fetch(start_cursor=cursor)
>>> pages = query_iter.pages
>>>
>>> first_page = next(pages)
>>> first_page_entities = list(first_page)
>>> query_iter.next_page_token is None
True
reserve_ids(complete_key, num_ids)

Reserve a list of IDs from a complete key.

transaction(**kwargs)

Proxy to google.cloud.datastore.transaction.Transaction.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-08-07 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4