Use our library to get convenient and idiomatic access to GRID’s REST API from Python. It’s generated from our OpenAPI specification.

Installation

The library is available as a package on PyPI. You can install the package with:

pip install grid_api

Before you start

Follow our getting started guide to get an API key and a workbook id.

You can use your API key in two ways: pass it directly to the Python client or, preferably, store it in an environment variable named GRID_API_KEY. Both methods are supported, but using an environment variable is the recommended approach for better security and maintainability.

export GRID_API_KEY="YOUR_API_KEY"

Example usage

With the SDK installed, you can query your workbook and get the formatted values in cells A1 to C10:

from grid_api import Grid

client = Grid(
    # Defaults to os.environ.get("GRID_API_KEY")
    api_key="YOUR_API_KEY",
)

response = client.workbooks.query(
    id="YOUR_WORKBOOK_ID",
    options={"values": "formatted" },
    read=["A1:C10"],
)
print(response.read)

This is just scratching the surface of what’s possible with GRID’s spreadsheet API and SDK. For more information, see our API documentation and see our SDK code on Github.