@@ -124,4 +124,73 @@ replacements:
124124 :maxdepth: 2
125125
126126 changelog
127+ count : 1
128+ - paths : [
129+ " packages/google-cloud-datastore/google/cloud/datastore/__init__.py" ,
130+ ]
131+ before : |
132+ from google.cloud.datastore import gapic_version as package_version
133+ [\s\S]*?"PlanSummary",\n\)
134+ after : |
135+ """Shortcut methods for getting set up with Google Cloud Datastore.
136+
137+ You'll typically use these to get started with the API:
138+
139+ .. doctest:: constructors
140+
141+ >>> from google.cloud import datastore
142+ >>>
143+ >>> client = datastore.Client()
144+ >>> key = client.key('EntityKind', 1234)
145+ >>> key
146+ <Key('EntityKind', 1234), project=...>
147+ >>> entity = datastore.Entity(key)
148+ >>> entity['question'] = u'Life, universe?' # Explicit unicode for text
149+ >>> entity['answer'] = 42
150+ >>> entity
151+ <Entity('EntityKind', 1234) {'question': 'Life, universe?', 'answer': 42}>
152+ >>> query = client.query(kind='EntityKind')
153+
154+ The main concepts with this API are:
155+
156+ - :class:`~google.cloud.datastore.client.Client`
157+ which represents a project (string), database (string), and namespace
158+ (string) bundled with a connection and has convenience methods for
159+ constructing objects with that project/database/namespace.
160+
161+ - :class:`~google.cloud.datastore.entity.Entity`
162+ which represents a single entity in the datastore
163+ (akin to a row in relational database world).
164+
165+ - :class:`~google.cloud.datastore.key.Key`
166+ which represents a pointer to a particular entity in the datastore
167+ (akin to a unique identifier in relational database world).
168+
169+ - :class:`~google.cloud.datastore.query.Query`
170+ which represents a lookup or search over the rows in the datastore.
171+
172+ - :class:`~google.cloud.datastore.transaction.Transaction`
173+ which represents an all-or-none transaction and enables consistency
174+ when race conditions may occur.
175+ """
176+
177+ from google.cloud.datastore.batch import Batch
178+ from google.cloud.datastore.client import Client
179+ from google.cloud.datastore.entity import Entity
180+ from google.cloud.datastore.key import Key
181+ from google.cloud.datastore.query import Query
182+ from google.cloud.datastore.query_profile import ExplainOptions
183+ from google.cloud.datastore.transaction import Transaction
184+ from google.cloud.datastore.version import __version__
185+
186+ __all__ = [
187+ "__version__",
188+ "Batch",
189+ "Client",
190+ "Entity",
191+ "Key",
192+ "Query",
193+ "ExplainOptions",
194+ "Transaction",
195+ ]
127196 count : 1
0 commit comments