A persistent dict
wrapper around Google Sheets using gspread
import gspread
from gspreaddict import GspreadDict
gc = gspread.service_account() # https://docs.gspread.org/en/latest/oauth2.html
db = GspreadDict(gc.open("My spreadsheet").sheet1)
# Keys can be str, and values can be str | None
db["colour"] = "blue"
db["shape"] = "triangle"
db["size"] = "large"
print(db["shape"]) # -> triangle
for key, value in db.items():
print(key, value) # colour blue shape triangle size large
print(len(db)) # 3
- Inspiration from sqlitedict