Cloud Spanner API Client Library for Python

While this library is still supported, we suggest trying the newer Cloud Client Library for Cloud Spanner, especially for new projects. See Cloud Spanner Libraries for installation and usage details.

Cloud Spanner API: Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service.

This page contains information about getting started with the Cloud Spanner API using the Google API Client Library for Python. In addition, you may be interested in the following documentation:

System requirements

Installing the client library

You can either use a package manager or download and install the Python client library manually:

Managed installation

Use pip or setuptools to manage your installation (you might need to run sudo first):

  • pip (preferred):
    $ pip install --upgrade google-api-python-client
  • Setuptools: Use the easy_install tool included in the setuptools package:
    $ easy_install --upgrade google-api-python-client

Manual installation

Download the latest client library for Python, unpack the code, and run python install

App Engine

Because the Python client libraries are not installed in the App Engine Python runtime environment, they must be vendored into your application just like third-party libraries.