Skip to main content

File-based Google Sheets representation library for LLM agents

Project description

extrasheet

File-based Google Sheets representation library for LLM agents.

Overview

extrasheet pulls a spreadsheet into a small set of TSV and JSON files that are easier for humans and agents to inspect than raw Google Sheets API responses. The current on-disk format uses:

  • spreadsheet.json for spreadsheet metadata, sheet list, previews, and truncation hints
  • data.tsv for cell values
  • formula.json for formulas
  • format.json for cell formatting, merges, notes, and rich text runs
  • Separate feature files such as charts.json, filters.json, pivot-tables.json, and data-validation.json
  • Optional per-sheet comments.json files for Google Drive comments

Some pulled files are informational only today and are not diffed or pushed back. See docs/gaps.md.

Python Usage

import asyncio
from extrasheet import GoogleSheetsTransport, SheetsClient


async def main() -> None:
    transport = GoogleSheetsTransport(access_token="your_token")
    client = SheetsClient(transport)

    try:
        await client.pull(
            "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms",
            "./output",
            max_rows=100,
            save_raw=True,
        )
    finally:
        await transport.close()


asyncio.run(main())

Typical output:

./output/<spreadsheet_id>/
  spreadsheet.json
  theme.json                     # optional, informational
  named_ranges.json              # optional, editable
  developer_metadata.json        # optional, informational
  data_sources.json              # optional, informational
  <sheet_folder>/
    data.tsv
    formula.json
    format.json                  # optional
    dimension.json               # optional
    charts.json                  # optional
    pivot-tables.json            # optional
    tables.json                  # optional
    filters.json                 # optional
    banded-ranges.json           # optional
    data-validation.json         # optional
    slicers.json                 # optional
    data-source-tables.json      # optional
    protection.json              # optional, informational
    comments.json                # optional, replies/resolve only
  .raw/
    metadata.json                # optional, saved unless save_raw=False
    data.json
  .pristine/
    spreadsheet.zip

CLI Usage

extrasheet is the library package. The CLI lives in extrasuite:

extrasuite sheet pull <url> [output_dir]
extrasuite sheet diff <folder>
extrasuite sheet push <folder>
extrasuite sheet batchUpdate <url> <requests.json>

Inside this repo you can run the local CLI with:

uv run --project client extrasuite sheet pull <url>

Notes

  • pull always fetches metadata first, then grid data with the requested row limit.
  • comments.json is fetched separately through the Drive API and written per sheet when comments exist.
  • .pristine/spreadsheet.zip is the baseline used by diff and push.
  • After any successful push, re-pull before editing again. .pristine is not updated in place.

Documentation

Development

cd extrasheet
uv sync --all-extras
uv run pytest tests/ -v
uv run ruff check .
uv run ruff format .
uv run mypy src/extrasheet

License

MIT License - see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

extrasheet-0.3.1.tar.gz (190.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

extrasheet-0.3.1-py3-none-any.whl (113.5 kB view details)

Uploaded Python 3

File details

Details for the file extrasheet-0.3.1.tar.gz.

File metadata

  • Download URL: extrasheet-0.3.1.tar.gz
  • Upload date:
  • Size: 190.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for extrasheet-0.3.1.tar.gz
Algorithm Hash digest
SHA256 b6adbe657cff92fde18f58fe371c5d509986b100bdafa5c322b34f09c76e111f
MD5 39bce419705b78f80b51f93d225725d9
BLAKE2b-256 6bdb6559ef215d2bd44af4e72ab7a42dffe972e86465e9832d7824866fd8bdb2

See more details on using hashes here.

Provenance

The following attestation bundles were made for extrasheet-0.3.1.tar.gz:

Publisher: publish-extrasheet.yml on think41/extrasuite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file extrasheet-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: extrasheet-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 113.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for extrasheet-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6d413fc495b1e4ae874613d35fe03a55eab2678c5829677fbb6c2f5da294fbba
MD5 e53c73c793617887028f89e2ffff13a1
BLAKE2b-256 2fe96e72b9178f96857dab9acd07507bbf000dda69c740d754c403bf31c007be

See more details on using hashes here.

Provenance

The following attestation bundles were made for extrasheet-0.3.1-py3-none-any.whl:

Publisher: publish-extrasheet.yml on think41/extrasuite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page