Google Sheets as a Backend — a database-like interface for Google Sheets.
Project description
GSAB — Google Sheets as a Backend
A database-like interface for Google Sheets — schemas, validation, field encryption, async CRUD, server-side queries, and a friction-free CLI. Sign in once; no Google Cloud setup required.
🌐 gsab.ajmalaksar.com · 📖 Docs · 🗺️ Roadmap
Install
pip install gsab # core
pip install "gsab[pandas]" # + DataFrame support
Get started
gsab auth login # browser sign-in (drive.file scope) — that's the whole setup
gsab init my-app # scaffold a runnable starter (add --fastapi for a CRUD API)
gsab doctor --live # prove it works end to end
Then define a schema and read/write your sheet. Full usage, examples and the API → the documentation. gsab import data.csv loads a CSV, and gsab cookbook list shows ready recipes.
Features
- Friction-free auth —
gsab auth loginopens a browser and uses the minimaldrive.filescope. No Cloud project, no JSON keys. DIY modes cover existing sheets, your own OAuth client, gcloud, and service accounts. - Schemas, keys & validation — typed fields, validation rules, and enforced
primary_key/uniquecolumns checked on every write. - Field encryption — flag a field
encrypted=Trueand it's sealed before it reaches the sheet. - Async CRUD + upsert —
insert / read / update / deleteplusupsert()for idempotent insert-or-update on a primary key, with rich filters ($gt / $in / $contains / $regexand more). - Server-side queries —
query()runs the Google Visualization query language (filter, sort, aggregate) on Google's side, not in Python. Values come back type-correct. - Reactive
watch()(Experimental) — an async generator that polls + diffs and emits{added, updated, removed}, seeing writes from any connection or the Google UI — drive a live, auto-updating UI. Polling (~1–2s), not push; one poller fans out to many viewers (seeexamples/realtime-demo/). - pandas bridge —
to_dataframe()/from_dataframe()andbulk_insert()for the whole analytics ecosystem. - Native charts —
chart()embeds a Google chart in the sheet; or handto_dataframe()to matplotlib/Plotly. - One-call public sharing —
share()publishes a created sheet to a read-only public link (andcsv_urlfor embedding);unshare()revokes. No extra scope — GSAB owns the sheets it makes. - Actionable errors — Google API errors become clear GSAB exceptions with retry/backoff and token refresh — readable by humans and LLM agents.
- Installable agent skills —
gsab skill installdrops GSAB skills into.claude/skills(or--portablefor any LLM) so your coding agent knows the real API. - MCP server —
gsab mcplets Claude (or any MCP host) use your Google Sheet as a database directly: create, insert, read, query, upsert, share.pip install "gsab[mcp]". - Secure tokens — stored in your OS keychain (keyring), with a 0600-file fallback.
Roadmap
Shipped (v0.8.0): auth + CLI · schemas, validation & encryption · async CRUD · upsert + enforced primary keys · type-correct server-side query · reactive watch() (Experimental) · one-call public sharing · MCP server (gsab mcp) · pandas bridge + bulk insert · native in-sheet charts · LLM-friendly errors + retry/backoff · installable agent skills · scaffolding & CSV import (gsab init / import / doctor / cookbook) · keychain storage.
Coming next: rate-aware batching · improved/pipe-friendly CLI · a JavaScript client · terminal UI · one-click hosted sign-in.
Full roadmap with per-feature stability (and what's deliberately out of scope) → ROADMAP.md. Live summary → gsab.ajmalaksar.com/#roadmap.
Releases
Versioned with SemVer; see CHANGELOG.md. Tagged releases (vX.Y.Z) publish to PyPI automatically via GitHub Actions.
License
MIT — see LICENSE.md. GSAB is an independent project, not affiliated with Google LLC.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gsab-0.8.0.tar.gz.
File metadata
- Download URL: gsab-0.8.0.tar.gz
- Upload date:
- Size: 10.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
04527af531f30a0d41f44b649607e6116ff6e7cde6d031f3d176b28f793296a3
|
|
| MD5 |
8574ba478ea2f854e58af8ac8aade247
|
|
| BLAKE2b-256 |
7a859517629311c4b478e9ce0031c51faa2b162f963b883297ae8e8a8b1c2356
|
Provenance
The following attestation bundles were made for gsab-0.8.0.tar.gz:
Publisher:
publish.yml on ajmalaksar25/gsab
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gsab-0.8.0.tar.gz -
Subject digest:
04527af531f30a0d41f44b649607e6116ff6e7cde6d031f3d176b28f793296a3 - Sigstore transparency entry: 1969112838
- Sigstore integration time:
-
Permalink:
ajmalaksar25/gsab@50d241d22ffc782121bd2c6d7cf14328d08a96f9 -
Branch / Tag:
refs/tags/v0.8.0 - Owner: https://github.com/ajmalaksar25
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@50d241d22ffc782121bd2c6d7cf14328d08a96f9 -
Trigger Event:
push
-
Statement type:
File details
Details for the file gsab-0.8.0-py3-none-any.whl.
File metadata
- Download URL: gsab-0.8.0-py3-none-any.whl
- Upload date:
- Size: 59.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c0a6de536f5e73a050210f6d1e62e39c12c1a9ed445c436d26af96e117af4ba7
|
|
| MD5 |
6b993bd3934a98298325ec89bd05ebe9
|
|
| BLAKE2b-256 |
cecd58607b960db8a030f2be29a967fe51b047d2363eb027854119c35173e955
|
Provenance
The following attestation bundles were made for gsab-0.8.0-py3-none-any.whl:
Publisher:
publish.yml on ajmalaksar25/gsab
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gsab-0.8.0-py3-none-any.whl -
Subject digest:
c0a6de536f5e73a050210f6d1e62e39c12c1a9ed445c436d26af96e117af4ba7 - Sigstore transparency entry: 1969112864
- Sigstore integration time:
-
Permalink:
ajmalaksar25/gsab@50d241d22ffc782121bd2c6d7cf14328d08a96f9 -
Branch / Tag:
refs/tags/v0.8.0 - Owner: https://github.com/ajmalaksar25
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@50d241d22ffc782121bd2c6d7cf14328d08a96f9 -
Trigger Event:
push
-
Statement type: