@robinpath/google-sheets
v0.1.1
Published
Google Sheets module for RobinPath.
Readme
@robinpath/google-sheets
Google Sheets module for RobinPath.
Why use this module?
The google-sheets module lets you:
- Read values from a spreadsheet range.
- Append a row of values to a spreadsheet.
- Clear all values in a spreadsheet range.
- Create a new Google Spreadsheet.
- List all sheets/tabs in a spreadsheet.
All functions are callable directly from RobinPath scripts with a simple, consistent API.
Installation
npm install @robinpath/google-sheetsQuick Start
1. Set up credentials
googleSheets.setCredentials "ya29.xxx"2. Read values from a spreadsheet range.
googleSheets.getValues "spreadsheet_id" "Sheet1!A1:C10"Available Functions
| Function | Description |
|----------|-------------|
| google-sheets.setCredentials | Set the OAuth2 access token for Google Sheets API. |
| google-sheets.getValues | Read values from a spreadsheet range. |
| google-sheets.setValues | Write values to a spreadsheet range. |
| google-sheets.appendRow | Append a row of values to a spreadsheet. |
| google-sheets.clearRange | Clear all values in a spreadsheet range. |
| google-sheets.create | Create a new Google Spreadsheet. |
| google-sheets.getSheets | List all sheets/tabs in a spreadsheet. |
| google-sheets.addSheet | Add a new sheet/tab to a spreadsheet. |
| google-sheets.deleteSheet | Delete a sheet/tab from a spreadsheet. |
| google-sheets.findRows | Find rows matching a value in a specific column. |
Examples
Read values from a spreadsheet range.
googleSheets.getValues "spreadsheet_id" "Sheet1!A1:C10"Write values to a spreadsheet range.
googleSheets.setValues "spreadsheet_id" "Sheet1!A1:B2" [[1,2],[3,4]]Append a row of values to a spreadsheet.
googleSheets.appendRow "spreadsheet_id" "Sheet1!A:C" ["Alice", 25, "[email protected]"]Integration with RobinPath
import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/google-sheets";
const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);
const result = await rp.executeScript(`
googleSheets.setCredentials "ya29.xxx"
googleSheets.getValues "spreadsheet_id" "Sheet1!A1:C10"
`);Full API Reference
See MODULE.md for complete documentation including all parameters, return types, error handling, and advanced examples.
Related Modules
@robinpath/google-calendar— Google Calendar module for complementary functionality@robinpath/google-contacts— Google Contacts module for complementary functionality@robinpath/google-forms— Google Forms module for complementary functionality@robinpath/gmail— Gmail module for complementary functionality@robinpath/outlook— Outlook module for complementary functionality
License
MIT
