Skip to content


docs: add instructions for using a Cloud Spanner emulator (#136)
Browse files Browse the repository at this point in the history
* docs: add instructions for using a Cloud Spanner emulator

* docs: address comment

Co-authored-by: larkee <>
  • Loading branch information
larkee and larkee committed Aug 24, 2020
1 parent 1513e7e commit 808837b
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions docs/client-usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,29 @@ Configuration

Be sure to use the **Project ID**, not the **Project Number**.

Using a Cloud Spanner Emulator

There are two ways to use the client with a Cloud Spanner emulator: programmatically or via an environment variable.

To programmatically use an emulator, you must specify the project, the endpoint of the emulator, and use anonymous credentials:

.. code:: python
from import spanner
from google.auth.credentials import AnonymousCredentials
client = spanner.Client(
client_options={"api_endpoint": ""},
To use an emulator via an environment variable, set the `SPANNER_EMULATOR_HOST` environment variable to the emulator endpoint:

.. code::
Next Step
Expand Down

0 comments on commit 808837b

Please sign in to comment.