pysheetson
A tiny Python client for the Sheetson API - Transform any Google Sheet into a REST API.
What is Sheetson?
Sheetson allows you to use Google Sheets as a database for your applications. Every Google Sheet becomes a database, and each tab becomes a table. No complex setup required!
Features
- ✅ CRUD Operations: Create, Read, Update, Delete rows
- ✅ Advanced Filtering: Use
whereclauses with operators ($gte, $lte, $in, etc.) - ✅ Sorting & Pagination: Order results and paginate through large datasets
- ✅ Batch Operations: Perform multiple operations efficiently
- ✅ DataFrame Support: Direct integration with pandas DataFrames
- ✅ Type Hints: Full typing support for better development experience
- ✅ Error Handling: Comprehensive error handling with custom exceptions
Quick Start
1. Setup Your Google Sheet
- Create a Google Sheet with headers in the first row
- Share it with
google@sheetson.comas an Editor - Get your API key from Sheetson Dashboard
2. Install pysheetson
pip install requests
# Optional: for DataFrame support
pip install pandas
3. Start Coding
from pysheetson import SheetsonClient
# Initialize client
client = SheetsonClient(
api_key="your_api_key_here",
spreadsheet_id="your_spreadsheet_id_here"
)
# Basic operations
cities = client.list_rows("Cities", limit=10)
new_city = client.create_row("Cities", {"name": "Paris", "country": "France"})
client.update_row("Cities", 2, {"population": "2161000"})
client.delete_row("Cities", 3)
# Advanced filtering
large_cities = client.search_rows("Cities",
where={"population": {"$gte": "1000000"}},
order_by="population",
desc=True
)
# Batch operations
operations = [
{"operation": "create", "data": {"name": "Tokyo", "country": "Japan"}},
{"operation": "update", "row_number": 2, "data": {"population": "37400068"}},
{"operation": "delete", "row_number": 5}
]
result = client.batch_operations("Cities", operations)
# DataFrame integration (requires pandas)
import pandas as pd
df = pd.DataFrame([
{"name": "London", "country": "UK"},
{"name": "Berlin", "country": "Germany"}
])
client.create_rows_from_dataframe("Cities", df)
Documentation
Examples
Check out the examples/ directory for more usage patterns:
quickstart.py- Basic operationsbatch_and_dataframe_example.py- Advanced features
Error Handling
from pysheetson import SheetsonError
try:
result = client.create_row("Cities", {"name": "Test"})
except SheetsonError as e:
print(f"API Error: {e}")
Development
# Clone the repository
git clone https://github.com/Mr-KAM/pysheetson.git
cd pysheetson
# Install in development mode
pip install -e .
# Run tests
python -m pytest tests/
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Links
Metadata
Release files for pysheetson 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pysheetson-0.1.1.tar.gz | 7.8 kB | Without provenance | Details |
Release files / pysheetson-0.1.1.tar.gz
| Download URL | pysheetson-0.1.1.tar.gz |
|---|---|
| Size | 7.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
852abed02789a11f6c35f69069d16ac02847bc869ef23f3f9f05d90d2a1b2412
|
|
BLAKE2b-256 checksum How to use checksums |
d8083e6ead6ded2d189dde57ad45700be4173f869e36923e5d651bc4d9a95fea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Security for pysheetson 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.