google-sheets
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGoogle Sheets
Google Sheets
Interact with Google Sheets for spreadsheet management, data manipulation, and formula operations.
通过该工具与Google Sheets交互,实现电子表格管理、数据处理及公式操作。
Installation
安装
-
Install Python dependencies:bash
pip install --user google-auth google-auth-oauthlib google-api-python-client keyring pyyaml -
Download the skill from Releases or use directly from this repository.
-
安装Python依赖包:bash
pip install --user google-auth google-auth-oauthlib google-api-python-client keyring pyyaml -
下载技能包:从Releases下载,或直接使用本仓库中的内容。
Setup Verification
配置验证
After installation, verify the skill is properly configured:
bash
python scripts/google-sheets.py checkThis will check:
- Python dependencies (google-auth, google-auth-oauthlib, google-api-python-client, keyring, pyyaml)
- Authentication configuration
- Connectivity to Google Sheets API
If anything is missing, the check command will provide setup instructions.
安装完成后,验证技能包是否配置正确:
bash
python scripts/google-sheets.py check该命令将检查以下内容:
- Python依赖包(google-auth、google-auth-oauthlib、google-api-python-client、keyring、pyyaml)
- 认证配置
- 与Google Sheets API的连通性
若有缺失,检查命令会提供对应的配置指引。
Authentication
认证
Google Sheets uses OAuth 2.0 for authentication. For complete setup instructions, see:
- GCP Project Setup Guide - Create project, enable Sheets API
- Google OAuth Setup Guide - Configure credentials
Google Sheets采用OAuth 2.0进行认证。完整配置指引请参考:
- GCP项目设置指南 - 创建项目,启用Sheets API
- Google OAuth设置指南 - 配置凭证
Quick Start
快速开始
-
Create:
~/.config/agent-skills/google.yamlyamloauth_client: client_id: your-client-id.apps.googleusercontent.com client_secret: your-client-secret -
Runto trigger OAuth flow and verify setup.
python scripts/google-sheets.py check
-
创建文件:
~/.config/agent-skills/google.yamlyamloauth_client: client_id: your-client-id.apps.googleusercontent.com client_secret: your-client-secret -
运行触发OAuth流程并验证配置。
python scripts/google-sheets.py check
OAuth Scopes
OAuth权限范围
The skill requests granular scopes for different operations:
| Scope | Permission | Used For |
|---|---|---|
| Read spreadsheets | Reading cell values and metadata |
| Full access | Creating and modifying spreadsheets |
该技能包针对不同操作请求精细化的权限范围:
| 权限范围 | 权限 | 用途 |
|---|---|---|
| 只读访问电子表格 | 读取单元格值和元数据 |
| 完全访问权限 | 创建和修改电子表格 |
Scope Errors
权限范围错误
If you encounter "insufficient scope" errors, revoke your token and re-authenticate:
- Revoke at https://myaccount.google.com/permissions
- Clear token:
keyring del agent-skills google-sheets-token-json - Re-run:
python scripts/google-sheets.py check
若遇到「权限不足」错误,请撤销现有令牌并重新认证:
- 访问https://myaccount.google.com/permissions进行撤销
- 清除令牌:
keyring del agent-skills google-sheets-token-json - 重新运行:
python scripts/google-sheets.py check
Commands
命令
check
check(检查)
Verify configuration and connectivity.
bash
python scripts/google-sheets.py checkThis validates:
- Python dependencies are installed
- Authentication is configured
- Can connect to Google Sheets API
- Creates a test spreadsheet to verify write access
验证配置与连通性。
bash
python scripts/google-sheets.py check该命令将验证:
- Python依赖包已安装
- 认证已配置
- 可连接至Google Sheets API
- 创建测试电子表格以验证写入权限
auth setup
auth setup(认证配置)
Store OAuth 2.0 client credentials for custom OAuth flow.
bash
python scripts/google-sheets.py auth setup \
--client-id YOUR_CLIENT_ID \
--client-secret YOUR_CLIENT_SECRETCredentials are saved to .
~/.config/agent-skills/google-sheets.yamlOptions:
- - OAuth 2.0 client ID (required)
--client-id - - OAuth 2.0 client secret (required)
--client-secret
存储OAuth 2.0客户端凭证,用于自定义OAuth流程。
bash
python scripts/google-sheets.py auth setup \
--client-id YOUR_CLIENT_ID \
--client-secret YOUR_CLIENT_SECRET凭证将保存至。
~/.config/agent-skills/google-sheets.yaml选项:
- - OAuth 2.0客户端ID(必填)
--client-id - - OAuth 2.0客户端密钥(必填)
--client-secret
spreadsheets create
spreadsheets create(创建电子表格)
Create a new Google Sheets spreadsheet.
bash
python scripts/google-sheets.py spreadsheets create --title "My Spreadsheet"Options:
- - Spreadsheet title (required)
--title - - Comma-separated sheet names (optional)
--sheets - - Output as JSON
--json
Example:
bash
undefined创建新的Google Sheets电子表格。
bash
python scripts/google-sheets.py spreadsheets create --title "My Spreadsheet"选项:
- - 电子表格标题(必填)
--title - - 逗号分隔的工作表名称(可选)
--sheets - - 以JSON格式输出结果
--json
示例:
bash
undefinedCreate with default Sheet1
创建默认包含Sheet1的电子表格
python scripts/google-sheets.py spreadsheets create --title "Sales Data"
python scripts/google-sheets.py spreadsheets create --title "Sales Data"
Create with custom sheets
创建包含自定义工作表的电子表格
python scripts/google-sheets.py spreadsheets create
--title "Q1 Report"
--sheets "Summary,January,February,March"
--title "Q1 Report"
--sheets "Summary,January,February,March"
python scripts/google-sheets.py spreadsheets create
--title "Q1 Report"
--sheets "Summary,January,February,March"
--title "Q1 Report"
--sheets "Summary,January,February,March"
Output:
输出:
✓ Spreadsheet created successfully
✓ Spreadsheet created successfully
Title: Q1 Report
Title: Q1 Report
Spreadsheet ID: 1abc...xyz
Spreadsheet ID: 1abc...xyz
Sheets: 4 (Summary, January, February, March)
Sheets: 4 (Summary, January, February, March)
undefinedundefinedspreadsheets get
spreadsheets get(获取电子表格信息)
Get spreadsheet metadata and structure.
bash
python scripts/google-sheets.py spreadsheets get SPREADSHEET_IDArguments:
- - The Google Sheets spreadsheet ID
spreadsheet_id
Options:
- - Output full spreadsheet structure as JSON
--json
Example:
bash
python scripts/google-sheets.py spreadsheets get 1abc...xyz获取电子表格的元数据和结构。
bash
python scripts/google-sheets.py spreadsheets get SPREADSHEET_ID参数:
- - Google Sheets电子表格ID
spreadsheet_id
选项:
- - 以JSON格式输出完整的电子表格结构
--json
示例:
bash
python scripts/google-sheets.py spreadsheets get 1abc...xyzOutput:
输出:
Title: Sales Data
Title: Sales Data
Spreadsheet ID: 1abc...xyz
Spreadsheet ID: 1abc...xyz
Sheets: 2 (Sheet1, Summary)
Sheets: 2 (Sheet1, Summary)
undefinedundefinedvalues read
values read(读取单元格值)
Read cell values from a range.
bash
python scripts/google-sheets.py values read SPREADSHEET_ID --range "Sheet1!A1:D5"Arguments:
- - The Google Sheets spreadsheet ID
spreadsheet_id
Options:
- - Range in A1 notation (required, e.g., "Sheet1!A1:D5")
--range - - Value format: FORMATTED_VALUE (default), UNFORMATTED_VALUE, or FORMULA
--format - - Output as JSON
--json
Example:
bash
undefined读取指定区域的单元格值。
bash
python scripts/google-sheets.py values read SPREADSHEET_ID --range "Sheet1!A1:D5"参数:
- - Google Sheets电子表格ID
spreadsheet_id
选项:
- - A1表示法的单元格区域(必填,例如"Sheet1!A1:D5")
--range - - 值格式:FORMATTED_VALUE(默认)、UNFORMATTED_VALUE或FORMULA
--format - - 以JSON格式输出结果
--json
示例:
bash
undefinedRead a range
读取指定区域
python scripts/google-sheets.py values read 1abc...xyz --range "Sheet1!A1:C3"
python scripts/google-sheets.py values read 1abc...xyz --range "Sheet1!A1:C3"
Output (formatted as table):
输出(表格格式):
Name | Age | City
Name | Age | City
Alice | 30 | NYC
Alice | 30 | NYC
Bob | 25 | LA
Bob | 25 | LA
Read formulas
读取公式
python scripts/google-sheets.py values read 1abc...xyz
--range "Sheet1!D1:D10"
--format FORMULA
--range "Sheet1!D1:D10"
--format FORMULA
See [references/range-notation.md](references/range-notation.md) for A1 notation details.python scripts/google-sheets.py values read 1abc...xyz
--range "Sheet1!D1:D10"
--format FORMULA
--range "Sheet1!D1:D10"
--format FORMULA
关于A1表示法的详细说明,请参考[references/range-notation.md](references/range-notation.md)。values write
values write(写入单元格值)
Write values to a range.
bash
python scripts/google-sheets.py values write SPREADSHEET_ID \
--range "Sheet1!A1" \
--values '[[\"Name\",\"Age\"],[\"Alice\",30]]'Arguments:
- - The Google Sheets spreadsheet ID
spreadsheet_id
Options:
- - Starting range in A1 notation (required)
--range - - Values as JSON 2D array (required)
--values - - Output API response as JSON
--json
Example:
bash
undefined向指定区域写入值。
bash
python scripts/google-sheets.py values write SPREADSHEET_ID \
--range "Sheet1!A1" \
--values '[[\"Name\",\"Age\"],[\"Alice\",30]]'参数:
- - Google Sheets电子表格ID
spreadsheet_id
选项:
- - A1表示法的起始区域(必填)
--range - - 以JSON二维数组格式表示的值(必填)
--values - - 以JSON格式输出API响应
--json
示例:
bash
undefinedWrite data starting at A1
从A1开始写入数据
python scripts/google-sheets.py values write 1abc...xyz
--range "Sheet1!A1"
--values '[["Product","Price","Quantity"],["Widget",9.99,100]]'
--range "Sheet1!A1"
--values '[["Product","Price","Quantity"],["Widget",9.99,100]]'
python scripts/google-sheets.py values write 1abc...xyz
--range "Sheet1!A1"
--values '[["Product","Price","Quantity"],["Widget",9.99,100]]'
--range "Sheet1!A1"
--values '[["Product","Price","Quantity"],["Widget",9.99,100]]'
Write a single row
写入单行数据
python scripts/google-sheets.py values write 1abc...xyz
--range "Sheet1!A5"
--values '[["Total",999,50]]'
--range "Sheet1!A5"
--values '[["Total",999,50]]'
python scripts/google-sheets.py values write 1abc...xyz
--range "Sheet1!A5"
--values '[["Total",999,50]]'
--range "Sheet1!A5"
--values '[["Total",999,50]]'
Output:
输出:
✓ Values written successfully
✓ Values written successfully
Updated cells: 6
Updated cells: 6
Updated range: Sheet1!A1:C2
Updated range: Sheet1!A1:C2
**Note:** Values are entered as the user would type them. Formulas start with `=`.
**注意:** 值的输入方式与用户手动输入一致。公式需以`=`开头。values append
values append(追加行数据)
Append rows to the end of a sheet.
bash
python scripts/google-sheets.py values append SPREADSHEET_ID \
--range "Sheet1" \
--values '[[\"New\",\"Row\",\"Data\"]]'Arguments:
- - The Google Sheets spreadsheet ID
spreadsheet_id
Options:
- - Sheet name or range (required)
--range - - Values as JSON 2D array (required)
--values - - Output API response as JSON
--json
Example:
bash
undefined在工作表末尾追加行数据。
bash
python scripts/google-sheets.py values append SPREADSHEET_ID \
--range "Sheet1" \
--values '[[\"New\",\"Row\",\"Data\"]]'参数:
- - Google Sheets电子表格ID
spreadsheet_id
选项:
- - 工作表名称或区域(必填)
--range - - 以JSON二维数组格式表示的值(必填)
--values - - 以JSON格式输出API响应
--json
示例:
bash
undefinedAppend a single row
追加单行数据
python scripts/google-sheets.py values append 1abc...xyz
--range "Sheet1"
--values '[["Charlie",35,"Chicago"]]'
--range "Sheet1"
--values '[["Charlie",35,"Chicago"]]'
python scripts/google-sheets.py values append 1abc...xyz
--range "Sheet1"
--values '[["Charlie",35,"Chicago"]]'
--range "Sheet1"
--values '[["Charlie",35,"Chicago"]]'
Append multiple rows
追加多行数据
python scripts/google-sheets.py values append 1abc...xyz
--range "Sheet1"
--values '[["David",28,"Boston"],["Eve",32,"Seattle"]]'
--range "Sheet1"
--values '[["David",28,"Boston"],["Eve",32,"Seattle"]]'
python scripts/google-sheets.py values append 1abc...xyz
--range "Sheet1"
--values '[["David",28,"Boston"],["Eve",32,"Seattle"]]'
--range "Sheet1"
--values '[["David",28,"Boston"],["Eve",32,"Seattle"]]'
Output:
输出:
✓ Values appended successfully
✓ Values appended successfully
Updated cells: 3
Updated cells: 3
Updated range: Sheet1!A4:C4
Updated range: Sheet1!A4:C4
undefinedundefinedvalues clear
values clear(清除单元格值)
Clear values in a range.
bash
python scripts/google-sheets.py values clear SPREADSHEET_ID --range "Sheet1!A1:D10"Arguments:
- - The Google Sheets spreadsheet ID
spreadsheet_id
Options:
- - Range in A1 notation (required)
--range - - Output API response as JSON
--json
Example:
bash
undefined清除指定区域的单元格值。
bash
python scripts/google-sheets.py values clear SPREADSHEET_ID --range "Sheet1!A1:D10"参数:
- - Google Sheets电子表格ID
spreadsheet_id
选项:
- - A1表示法的单元格区域(必填)
--range - - 以JSON格式输出API响应
--json
示例:
bash
undefinedClear a range
清除指定区域
python scripts/google-sheets.py values clear 1abc...xyz --range "Sheet1!A1:Z100"
python scripts/google-sheets.py values clear 1abc...xyz --range "Sheet1!A1:Z100"
Output:
输出:
✓ Values cleared successfully
✓ Values cleared successfully
Cleared range: Sheet1!A1:Z100
Cleared range: Sheet1!A1:Z100
**Warning:** This only clears values, not formatting or formulas in protected cells.
**警告:** 该操作仅清除值,不会清除受保护单元格中的格式或公式。sheets create
sheets create(创建工作表)
Add a new sheet to a spreadsheet.
bash
python scripts/google-sheets.py sheets create SPREADSHEET_ID --title "New Sheet"Arguments:
- - The Google Sheets spreadsheet ID
spreadsheet_id
Options:
- - Sheet title (required)
--title - - Output API response as JSON
--json
Example:
bash
python scripts/google-sheets.py sheets create 1abc...xyz --title "Q2 Data"向电子表格中添加新的工作表。
bash
python scripts/google-sheets.py sheets create SPREADSHEET_ID --title "New Sheet"参数:
- - Google Sheets电子表格ID
spreadsheet_id
选项:
- - 工作表标题(必填)
--title - - 以JSON格式输出API响应
--json
示例:
bash
python scripts/google-sheets.py sheets create 1abc...xyz --title "Q2 Data"Output:
输出:
✓ Sheet created successfully
✓ Sheet created successfully
Title: Q2 Data
Title: Q2 Data
Sheet ID: 123456789
Sheet ID: 123456789
undefinedundefinedsheets delete
sheets delete(删除工作表)
Delete a sheet from a spreadsheet.
bash
python scripts/google-sheets.py sheets delete SPREADSHEET_ID --sheet-id 123456789Arguments:
- - The Google Sheets spreadsheet ID
spreadsheet_id
Options:
- - Sheet ID (required, not the title!)
--sheet-id - - Output API response as JSON
--json
Example:
bash
undefined从电子表格中删除指定工作表。
bash
python scripts/google-sheets.py sheets delete SPREADSHEET_ID --sheet-id 123456789参数:
- - Google Sheets电子表格ID
spreadsheet_id
选项:
- - 工作表ID(必填,并非工作表标题!)
--sheet-id - - 以JSON格式输出API响应
--json
示例:
bash
undefinedGet sheet IDs first
先获取工作表ID
python scripts/google-sheets.py spreadsheets get 1abc...xyz --json | jq '.sheets[].properties | {title, sheetId}'
python scripts/google-sheets.py spreadsheets get 1abc...xyz --json | jq '.sheets[].properties | {title, sheetId}'
Delete a sheet
删除工作表
python scripts/google-sheets.py sheets delete 1abc...xyz --sheet-id 123456789
python scripts/google-sheets.py sheets delete 1abc...xyz --sheet-id 123456789
Output:
输出:
✓ Sheet deleted successfully
✓ Sheet deleted successfully
**Warning:** Cannot delete the last remaining sheet in a spreadsheet.
**警告:** 无法删除电子表格中仅剩的最后一个工作表。Examples
示例
Create and populate a spreadsheet
创建并填充电子表格
bash
undefinedbash
undefinedCreate spreadsheet
创建电子表格
SS_ID=$(python scripts/google-sheets.py spreadsheets create
--title "Employee Data" --json | jq -r '.spreadsheetId')
--title "Employee Data" --json | jq -r '.spreadsheetId')
SS_ID=$(python scripts/google-sheets.py spreadsheets create
--title "Employee Data" --json | jq -r '.spreadsheetId')
--title "Employee Data" --json | jq -r '.spreadsheetId')
Write headers
写入表头
python scripts/google-sheets.py values write $SS_ID
--range "Sheet1!A1"
--values '[["Name","Department","Salary","Start Date"]]'
--range "Sheet1!A1"
--values '[["Name","Department","Salary","Start Date"]]'
python scripts/google-sheets.py values write $SS_ID
--range "Sheet1!A1"
--values '[["Name","Department","Salary","Start Date"]]'
--range "Sheet1!A1"
--values '[["Name","Department","Salary","Start Date"]]'
Append employee records
追加员工记录
python scripts/google-sheets.py values append $SS_ID
--range "Sheet1"
--values '[["Alice","Engineering",120000,"2023-01-15"],["Bob","Sales",95000,"2023-03-01"]]'
--range "Sheet1"
--values '[["Alice","Engineering",120000,"2023-01-15"],["Bob","Sales",95000,"2023-03-01"]]'
python scripts/google-sheets.py values append $SS_ID
--range "Sheet1"
--values '[["Alice","Engineering",120000,"2023-01-15"],["Bob","Sales",95000,"2023-03-01"]]'
--range "Sheet1"
--values '[["Alice","Engineering",120000,"2023-01-15"],["Bob","Sales",95000,"2023-03-01"]]'
Add a summary sheet
添加汇总工作表
python scripts/google-sheets.py sheets create $SS_ID --title "Summary"
python scripts/google-sheets.py sheets create $SS_ID --title "Summary"
Read the data
读取数据
python scripts/google-sheets.py values read $SS_ID --range "Sheet1!A1:D10"
undefinedpython scripts/google-sheets.py values read $SS_ID --range "Sheet1!A1:D10"
undefinedWork with formulas
公式操作
bash
undefinedbash
undefinedWrite data with formulas
写入包含公式的数据
python scripts/google-sheets.py values write $SS_ID
--range "Sheet1!A1"
--values '[["Item","Price","Qty","Total"],["Widget",10,5,"=B2C2"],["Gadget",20,3,"=B3C3"]]'
--range "Sheet1!A1"
--values '[["Item","Price","Qty","Total"],["Widget",10,5,"=B2C2"],["Gadget",20,3,"=B3C3"]]'
python scripts/google-sheets.py values write $SS_ID
--range "Sheet1!A1"
--values '[["Item","Price","Qty","Total"],["Widget",10,5,"=B2C2"],["Gadget",20,3,"=B3C3"]]'
--range "Sheet1!A1"
--values '[["Item","Price","Qty","Total"],["Widget",10,5,"=B2C2"],["Gadget",20,3,"=B3C3"]]'
Read formulas
读取公式
python scripts/google-sheets.py values read $SS_ID
--range "Sheet1!D2:D3"
--format FORMULA
--range "Sheet1!D2:D3"
--format FORMULA
python scripts/google-sheets.py values read $SS_ID
--range "Sheet1!D2:D3"
--format FORMULA
--range "Sheet1!D2:D3"
--format FORMULA
Read calculated values
读取计算后的值
python scripts/google-sheets.py values read $SS_ID
--range "Sheet1!D2:D3"
--format FORMATTED_VALUE
--range "Sheet1!D2:D3"
--format FORMATTED_VALUE
undefinedpython scripts/google-sheets.py values read $SS_ID
--range "Sheet1!D2:D3"
--format FORMATTED_VALUE
--range "Sheet1!D2:D3"
--format FORMATTED_VALUE
undefinedBatch operations
批量操作
bash
#!/bin/bash
SS_ID="your-spreadsheet-id"bash
#!/bin/bash
SS_ID="your-spreadsheet-id"Clear old data
清除旧数据
python scripts/google-sheets.py values clear $SS_ID --range "Sheet1!A1:Z1000"
python scripts/google-sheets.py values clear $SS_ID --range "Sheet1!A1:Z1000"
Write new data in batches
写入新表头
python scripts/google-sheets.py values write $SS_ID
--range "Sheet1!A1"
--values '[["Date","Revenue","Expenses","Profit"]]'
--range "Sheet1!A1"
--values '[["Date","Revenue","Expenses","Profit"]]'
for month in Jan Feb Mar; do
python scripts/google-sheets.py values append $SS_ID
--range "Sheet1"
--values "[["$month",10000,7000,"=B${ROW}-C${ROW}"]]" done
--range "Sheet1"
--values "[["$month",10000,7000,"=B${ROW}-C${ROW}"]]" done
undefinedpython scripts/google-sheets.py values write $SS_ID
--range "Sheet1!A1"
--values '[["Date","Revenue","Expenses","Profit"]]'
--range "Sheet1!A1"
--values '[["Date","Revenue","Expenses","Profit"]]'
for month in Jan Feb Mar; do
python scripts/google-sheets.py values append $SS_ID
--range "Sheet1"
--values "[["$month",10000,7000,"=B${ROW}-C${ROW}"]]" done
--range "Sheet1"
--values "[["$month",10000,7000,"=B${ROW}-C${ROW}"]]" done
undefinedTroubleshooting
故障排查
"Insufficient scope" errors
「权限不足」错误
You need to revoke and re-authenticate to grant additional permissions:
- Go to https://myaccount.google.com/permissions
- Find "Agent Skills" and remove access
- Delete stored token:
keyring del agent-skills google-sheets-token-json - Run to re-authenticate
python scripts/google-sheets.py check
你需要撤销现有认证并重新授权以获取额外权限:
- 访问https://myaccount.google.com/permissions
- 找到「Agent Skills」并移除访问权限
- 删除存储的令牌:
keyring del agent-skills google-sheets-token-json - 运行重新认证
python scripts/google-sheets.py check
Cannot find spreadsheet
无法找到电子表格
Make sure you're using the correct spreadsheet ID from the URL:
- URL:
https://docs.google.com/spreadsheets/d/1abc...xyz/edit - Spreadsheet ID:
1abc...xyz
确保你使用的是URL中的正确电子表格ID:
- URL:
https://docs.google.com/spreadsheets/d/1abc...xyz/edit - 电子表格ID:
1abc...xyz
Invalid range errors
无效区域错误
- Use proper A1 notation:
Sheet1!A1:D5 - Sheet names with spaces need quotes:
'My Sheet'!A1:B2 - See references/range-notation.md for details
- 使用正确的A1表示法:
Sheet1!A1:D5 - 包含空格的工作表名称需要加引号:
'My Sheet'!A1:B2 - 详细说明请参考references/range-notation.md
JSON parsing errors for --values
--values参数JSON解析错误
Ensure proper JSON escaping:
bash
undefined确保JSON格式正确转义:
bash
undefinedCorrect
正确写法
--values '[["Hello","World"]]'
--values "[["Name","Age"]]"
--values '[["Hello","World"]]'
--values "[["Name","Age"]]"
Incorrect
错误写法
--values [[Hello,World]] # Missing quotes
undefined--values [[Hello,World]] # 缺少引号
undefinedSheet ID vs Sheet Title
工作表ID vs 工作表标题
Commands use different identifiers:
- - Uses title (string)
sheets create - - Uses sheet ID (number)
sheets delete - Use to find sheet IDs
spreadsheets get --json
不同命令使用不同的标识符:
- - 使用标题(字符串)
sheets create - - 使用工作表ID(数字)
sheets delete - 使用命令查找工作表ID
spreadsheets get --json
Dependencies not found
依赖包未找到
Install required dependencies:
bash
pip install --user google-auth google-auth-oauthlib google-api-python-client keyring pyyaml安装所需的依赖包:
bash
pip install --user google-auth google-auth-oauthlib google-api-python-client keyring pyyamlOAuth flow fails
OAuth流程失败
Ensure your GCP project has:
- Google Sheets API enabled ()
sheets.googleapis.com - OAuth 2.0 credentials created
- OAuth consent screen configured
- Your email added as a test user (if app is in testing mode)
See docs/gcp-project-setup.md for detailed instructions.
确保你的GCP项目满足以下条件:
- 已启用Google Sheets API ()
sheets.googleapis.com - 已创建OAuth 2.0凭证
- 已配置OAuth同意屏幕
- 你的邮箱已添加为测试用户(若应用处于测试模式)
详细指引请参考docs/gcp-project-setup.md。
Related Skills
相关技能包
- Google Drive - File management (Drive manages file metadata, Sheets manages content)
- Google Docs - Document creation and editing
- Google Slides - Presentation management
- Google Drive - 文件管理(Drive管理文件元数据,Sheets管理内容)
- Google Docs - 文档创建与编辑
- Google Slides - 演示文稿管理
API Reference
API参考
For advanced usage, see:
- Google Sheets API Documentation
- Reading and writing cell values
- A1 notation reference
- Formula examples
如需高级用法,请参考:
- Google Sheets API文档
- 读写单元格值
- A1表示法参考
- 公式示例