Metadata-Version: 2.4
Name: gsab
Version: 0.3.1
Summary: Google Sheets as a Backend — a database-like interface for Google Sheets.
Project-URL: Homepage, https://github.com/ajmalaksar25/gsab
Project-URL: Repository, https://github.com/ajmalaksar25/gsab
Project-URL: Issues, https://github.com/ajmalaksar25/gsab/issues
Author-email: Ajmal Aksar <ajmalaksar25@gmail.com>
License: MIT License
        
        Copyright (c) 2024 Ajmal Aksar
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE. 
License-File: LICENSE.md
Keywords: backend,cli,database,google-sheets,orm,spreadsheet
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Database
Requires-Python: >=3.9
Requires-Dist: cryptography>=35.0.0
Requires-Dist: google-api-python-client>=2.31.0
Requires-Dist: google-auth-oauthlib>=0.5.0
Requires-Dist: google-auth>=2.3.3
Requires-Dist: keyring>=24.0
Requires-Dist: platformdirs>=3.0.0
Requires-Dist: python-dotenv>=0.19.2
Requires-Dist: typer>=0.12.0
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Requires-Dist: ruff>=0.6.0; extra == 'dev'
Provides-Extra: mcp
Requires-Dist: mcp>=1.0.0; extra == 'mcp'
Provides-Extra: pandas
Requires-Dist: pandas>=2.0; extra == 'pandas'
Provides-Extra: server
Requires-Dist: aiofiles>=0.8.0; extra == 'server'
Requires-Dist: fastapi>=0.68.0; extra == 'server'
Requires-Dist: jinja2>=3.0.0; extra == 'server'
Requires-Dist: python-multipart>=0.0.5; extra == 'server'
Requires-Dist: uvicorn>=0.15.0; extra == 'server'
Provides-Extra: tui
Requires-Dist: textual>=0.50.0; extra == 'tui'
Description-Content-Type: text/markdown

# GSAB — Google Sheets as a Backend

[![PyPI](https://img.shields.io/pypi/v/gsab.svg)](https://pypi.org/project/gsab/)
[![Python](https://img.shields.io/pypi/pyversions/gsab.svg)](https://pypi.org/project/gsab/)
[![License: MIT](https://img.shields.io/badge/license-MIT-1b7a4b.svg)](LICENSE.md)
[![Tests](https://github.com/ajmalaksar25/gsab/actions/workflows/tests.yml/badge.svg)](https://github.com/ajmalaksar25/gsab/actions/workflows/tests.yml)

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](https://gsab.ajmalaksar.com) &nbsp;·&nbsp; 📖 [Docs](https://gsab.ajmalaksar.com/docs) &nbsp;·&nbsp; 🗺️ [Roadmap](https://gsab.ajmalaksar.com/#roadmap)

## Install

```bash
pip install gsab          # core
pip install "gsab[pandas]"  # + DataFrame support
```

## Get started

```bash
gsab auth login           # browser sign-in (drive.file scope) — that's the whole setup
```

Then define a schema and read/write your sheet. **Full usage, examples and the API → [the documentation](https://gsab.ajmalaksar.com/docs).**

## Features

- **Friction-free auth** — `gsab auth login` opens a browser and uses the minimal `drive.file` scope. No Cloud project, no JSON keys. DIY modes cover existing sheets, your own OAuth client, gcloud, and service accounts.
- **Schemas & validation** — typed fields, rules and uniqueness, enforced on every write.
- **Field encryption** — flag a field `encrypted=True` and it's sealed before it reaches the sheet.
- **Async CRUD + rich filters** — `insert / read / update / delete` with `$gt / $in / $contains / $regex` and 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.
- **pandas bridge** — `to_dataframe()` / `from_dataframe()` and `bulk_insert()` for the whole analytics ecosystem.
- **Native charts** — `chart()` embeds a Google chart in the sheet; or hand `to_dataframe()` to matplotlib/Plotly.
- **Actionable errors** — Google API errors become clear GSAB exceptions with retry/backoff and token refresh — readable by humans and LLM agents.
- **Secure tokens** — stored in your OS keychain (keyring), with a 0600-file fallback.

## Roadmap

**Shipped (v0.3.1):** auth + CLI · schemas, validation & encryption · async CRUD · type-correct server-side query · pandas bridge + bulk insert · native in-sheet charts · LLM-friendly errors + retry/backoff · keychain storage.

**Coming next:** MCP server (use your sheets from Claude) · terminal UI · real-time / reactive mode · server-side date filters · one-click hosted sign-in.

Live roadmap → [gsab.ajmalaksar.com/#roadmap](https://gsab.ajmalaksar.com/#roadmap).

## Releases

Versioned with [SemVer](https://semver.org); see [CHANGELOG.md](CHANGELOG.md). Tagged releases (`vX.Y.Z`) publish to PyPI automatically via GitHub Actions.

## License

MIT — see [LICENSE.md](LICENSE.md). GSAB is an independent project, not affiliated with Google LLC.
