Skip to content

Commit

Permalink
Updated documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgeewax committed Jan 30, 2014
1 parent 95d0903 commit 651839c
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 30 deletions.
38 changes: 23 additions & 15 deletions docs/datastore-getting-started.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Full 'getting started' guide
----------------------------

Creating a project
~~~~~~~~~~~~~~~~~~
Getting started with Cloud Datastore
====================================

.. note::
If you don't have a Google account,
you should probably sign up for one now...
If you just want to kick the tires,
you might prefer :doc:`datastore-quickstart`.

Creating a project
------------------

* **Create a project**

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

Enable the Cloud Datastore API
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------

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

Enable a "Service Account"
~~~~~~~~~~~~~~~~~~~~~~~~~~
--------------------------

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

Add some data to your Datastore
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Add some data to your dataset
-----------------------------

Open a Python console and...

>>> import gclouddatastore
>>> dataset = gclouddatastore.get_dataset('<your-project-id-here',
'<the e-mail address you copied here>',
'/path/to/<your project>.key')
>>> from gcloud import datastore
>>> dataset = datastore.get_dataset(
>>> '<your-project-id-here',
>>> '<the e-mail address you copied here>',
>>> '/path/to/<your project>.key')
>>> dataset.query().fetch()
[]
>>> entity = dataset.entity('Person')
Expand All @@ -119,3 +120,10 @@ Open a Python console and...
>>> entity.save()
>>> dataset.query('Person').fetch()
[<Entity{...} {'name': 'Your name', 'age': 25}>]

And that's it!
--------------

Next,
take a look at the complete
:doc:`datastore-api`.
44 changes: 29 additions & 15 deletions docs/datastore-quickstart.rst
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
Get started in 10 seconds
-------------------------
Cloud Datastore in 10 seconds
=============================

.. warning::
This will use a *shared* dataset,
.. note::
This will use a **shared** dataset,
which means any data you save
will be available to anyone.

If you want to create your own dataset,
follow the
(pretty simple)
instructions in the
:doc:`datastore-getting-started`.

Install the library
~~~~~~~~~~~~~~~~~~~
-------------------

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

$ python -m gcloud.datastore.demo

Try it yourself
~~~~~~~~~~~~~~~
And that's it!
You just read and wrote a bunch of data
to the Cloud Datastore.

Crack open a Python interactive shell::
Try it yourself
---------------

$ python # or ipython
You can interact with a demo dataset
in a Python interactive shell.

And play with the demo dataset::
Start by importing the demo module
and instantiating the demo dataset::

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

But once you have the dataset,
you can manipulate data in the datastore::
Once you have the dataset,
you can create entities and save them::

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

The ``get_dataset`` method is just a shortcut for::
.. note::
The ``get_dataset`` method is just a shortcut for::

>>> from gcloud import datastore
>>> from gcloud.datastore import demo
>>> dataset = datastore.get_dataset(
demo.DATASET_ID, demo.CLIENT_EMAIL, demo.PRIVATE_KEY_PATH)
>>> demo.DATASET_ID, demo.CLIENT_EMAIL, demo.PRIVATE_KEY_PATH)

OK, that's it!
--------------

Next,
take a look at the :doc:`datastore-getting-started`
to see how to create your own project and dataset.

And you can always check out
the :doc:`datastore-api`.

0 comments on commit 651839c

Please sign in to comment.