Skip to content

Commit 651839c

Browse files
committed
Updated documentation.
1 parent 95d0903 commit 651839c

File tree

2 files changed

+52
-30
lines changed

2 files changed

+52
-30
lines changed

docs/datastore-getting-started.rst

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
Full 'getting started' guide
2-
----------------------------
3-
4-
Creating a project
5-
~~~~~~~~~~~~~~~~~~
1+
Getting started with Cloud Datastore
2+
====================================
63

74
.. note::
8-
If you don't have a Google account,
9-
you should probably sign up for one now...
5+
If you just want to kick the tires,
6+
you might prefer :doc:`datastore-quickstart`.
7+
8+
Creating a project
9+
------------------
1010

1111
* **Create a project**
1212

@@ -37,7 +37,7 @@ Then click OK
3737
(give it a second to create your project).
3838

3939
Enable the Cloud Datastore API
40-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
40+
------------------------------
4141

4242
Now that you created a project,
4343
you need to *turn on* the Cloud Datastore API.
@@ -54,7 +54,7 @@ which services you intend to use for this project.
5454
to turn it into an "On" button.
5555

5656
Enable a "Service Account"
57-
~~~~~~~~~~~~~~~~~~~~~~~~~~
57+
--------------------------
5858

5959
Now that you have a project
6060
that has access to the Cloud Datastore API,
@@ -102,15 +102,16 @@ To create a Service Account:
102102
OK. That's it!
103103
Time to start doing things with your Cloud Datastore project.
104104

105-
Add some data to your Datastore
106-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
105+
Add some data to your dataset
106+
-----------------------------
107107

108108
Open a Python console and...
109109

110-
>>> import gclouddatastore
111-
>>> dataset = gclouddatastore.get_dataset('<your-project-id-here',
112-
'<the e-mail address you copied here>',
113-
'/path/to/<your project>.key')
110+
>>> from gcloud import datastore
111+
>>> dataset = datastore.get_dataset(
112+
>>> '<your-project-id-here',
113+
>>> '<the e-mail address you copied here>',
114+
>>> '/path/to/<your project>.key')
114115
>>> dataset.query().fetch()
115116
[]
116117
>>> entity = dataset.entity('Person')
@@ -119,3 +120,10 @@ Open a Python console and...
119120
>>> entity.save()
120121
>>> dataset.query('Person').fetch()
121122
[<Entity{...} {'name': 'Your name', 'age': 25}>]
123+
124+
And that's it!
125+
--------------
126+
127+
Next,
128+
take a look at the complete
129+
:doc:`datastore-api`.

docs/datastore-quickstart.rst

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
Get started in 10 seconds
2-
-------------------------
1+
Cloud Datastore in 10 seconds
2+
=============================
33

4-
.. warning::
5-
This will use a *shared* dataset,
4+
.. note::
5+
This will use a **shared** dataset,
66
which means any data you save
77
will be available to anyone.
8-
98
If you want to create your own dataset,
109
follow the
1110
(pretty simple)
1211
instructions in the
1312
:doc:`datastore-getting-started`.
1413

1514
Install the library
16-
~~~~~~~~~~~~~~~~~~~
15+
-------------------
1716

1817
The source code for the library
1918
(and demo code)
@@ -28,20 +27,24 @@ included in the package::
2827

2928
$ python -m gcloud.datastore.demo
3029

31-
Try it yourself
32-
~~~~~~~~~~~~~~~
30+
And that's it!
31+
You just read and wrote a bunch of data
32+
to the Cloud Datastore.
3333

34-
Crack open a Python interactive shell::
34+
Try it yourself
35+
---------------
3536

36-
$ python # or ipython
37+
You can interact with a demo dataset
38+
in a Python interactive shell.
3739

38-
And play with the demo dataset::
40+
Start by importing the demo module
41+
and instantiating the demo dataset::
3942

4043
>>> from gcloud.datastore import demo
4144
>>> dataset = demo.get_dataset()
4245

43-
But once you have the dataset,
44-
you can manipulate data in the datastore::
46+
Once you have the dataset,
47+
you can create entities and save them::
4548

4649
>>> dataset.query('MyExampleKind').fetch()
4750
[<Entity{...}, ]
@@ -52,9 +55,20 @@ you can manipulate data in the datastore::
5255
>>> dataset.query('Person').fetch()
5356
[<Entity{...} {'name': 'Your name', 'age': 25}>]
5457

55-
The ``get_dataset`` method is just a shortcut for::
58+
.. note::
59+
The ``get_dataset`` method is just a shortcut for::
5660

5761
>>> from gcloud import datastore
5862
>>> from gcloud.datastore import demo
5963
>>> dataset = datastore.get_dataset(
60-
demo.DATASET_ID, demo.CLIENT_EMAIL, demo.PRIVATE_KEY_PATH)
64+
>>> demo.DATASET_ID, demo.CLIENT_EMAIL, demo.PRIVATE_KEY_PATH)
65+
66+
OK, that's it!
67+
--------------
68+
69+
Next,
70+
take a look at the :doc:`datastore-getting-started`
71+
to see how to create your own project and dataset.
72+
73+
And you can always check out
74+
the :doc:`datastore-api`.

0 commit comments

Comments
 (0)