GoogleSheetsTools after configuring service-account or OAuth credentials.
googlesheets_tools.py
Run the Example
1
Set up your virtual environment
2
Install dependencies
3
Export your OpenAI API key
4
Configure Google Sheets authentication
Enable the Google Sheets API. Then choose one credential flow: set
GOOGLE_SERVICE_ACCOUNT_FILE to a service-account JSON key and share the target sheet with that account’s email; or create an OAuth desktop client, save its JSON as credentials.json beside the script, and authorize in the browser. With oauth_port=8080, use http://localhost:8080/ as the local redirect URI. If your OAuth client requires registered redirect URIs, register that exact URL.5
Run the example
Save the code above as
googlesheets_tools.py, then run: