Skip to main content
The Google Sheets resource exposes Sheets spreadsheets as a virtual filesystem mounted at some prefix such as /gsheets/. For Google OAuth setup, see Google Workspace Setup.

Config

Filesystem Layout

Example:
Spreadsheets are split into owned (spreadsheets you created) and shared (spreadsheets shared with you). The filename shape is:
If the modified date is unavailable, the date prefix is omitted. Reading a spreadsheet file returns the full Google Sheets API JSON for that spreadsheet, including sheet metadata.

Cache

The Google Sheets resource uses IndexCacheStore. Index entries store spreadsheet IDs and metadata. There is no separate content cache — file content caching is handled by the workspace IOResult mechanism.

Example

See examples/gsheets/gsheets.py for the full working example.

Shell Commands

Standard commands available on the mounted Google Sheets tree: Resource-specific commands:

gws-sheets-read

Read cell values from a spreadsheet range.
Returns the cell values as JSON.

gws-sheets-write

Write cell values to a spreadsheet range.
Returns the update response JSON.

gws-sheets-append

Append rows to a spreadsheet.
Either --values or --json-values is required. Returns the append response JSON.

gws-sheets-spreadsheets-create

Create a new spreadsheet.
Returns the created spreadsheet JSON.

gws-sheets-spreadsheets-batchUpdate

Batch update a spreadsheet.
Returns the batch update response JSON.