excel by sundial-org/awesome-openclaw-skills
npx skills add https://github.com/sundial-org/awesome-openclaw-skills --skill excel全面的 Excel 文件操作功能 - 读取、写入、编辑、格式化和导出。
pip install openpyxl
# 或使用 uv(推荐)
uv run --with openpyxl python3 scripts/excel.py --help
cd skills/excel
# 获取文件信息
python3 scripts/excel.py info report.xlsx
# 读取整个工作表
python3 scripts/excel.py read report.xlsx
python3 scripts/excel.py read report.xlsx --format markdown
python3 scripts/excel.py read report.xlsx --sheet "Sales" --range A1:D10
# 读取特定单元格
python3 scripts/excel.py cell report.xlsx B5
# 创建新工作簿
python3 scripts/excel.py create output.xlsx
python3 scripts/excel.py create output.xlsx --sheets "Data,Summary,Charts"
# 写入数据
python3 scripts/excel.py write output.xlsx --data '[[1,2,3],[4,5,6]]'
python3 scripts/excel.py write output.xlsx --data '{"headers":["Name","Age"],"rows":[["Alice",30],["Bob",25]]}'
# 编辑单元格
python3 scripts/excel.py edit report.xlsx A1 "New Value"
python3 scripts/excel.py edit report.xlsx B2 "SUM(A1:A10)" --formula
# 导出
python3 scripts/excel.py to-csv report.xlsx output.csv
python3 scripts/excel.py to-json report.xlsx output.json
python3 scripts/excel.py to-markdown report.xlsx
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
info - 获取工作簿元数据
python3 scripts/excel.py info report.xlsx
# 返回:工作表、维度、行/列计数
read - 读取工作表数据
python3 scripts/excel.py read file.xlsx # JSON 输出
python3 scripts/excel.py read file.xlsx --format csv # CSV 输出
python3 scripts/excel.py read file.xlsx --format markdown # Markdown 表格
python3 scripts/excel.py read file.xlsx --sheet "Sheet2" # 特定工作表
python3 scripts/excel.py read file.xlsx --range A1:D10 # 特定范围
cell - 读取特定单元格
python3 scripts/excel.py cell file.xlsx A1
python3 scripts/excel.py cell file.xlsx B5 --sheet "Data"
# 返回:值、公式(如果有)、数据类型、合并状态
create - 创建新工作簿
python3 scripts/excel.py create new.xlsx
python3 scripts/excel.py create new.xlsx --sheets "Sheet1,Sheet2,Summary"
write - 向单元格写入数据
# 二维数组
python3 scripts/excel.py write file.xlsx --data '[[1,2,3],[4,5,6]]'
# 带表头
python3 scripts/excel.py write file.xlsx --data '{"headers":["A","B"],"rows":[[1,2],[3,4]]}'
# 从特定单元格开始
python3 scripts/excel.py write file.xlsx --data '[[1,2]]' --start C5
# 键值对
python3 scripts/excel.py write file.xlsx --data '{"Name":"Alice","Age":30}'
from-csv - 从 CSV 创建 Excel
python3 scripts/excel.py from-csv data.csv output.xlsx
python3 scripts/excel.py from-csv data.csv output.xlsx --sheet "Imported"
from-json - 从 JSON 创建 Excel
python3 scripts/excel.py from-json data.json output.xlsx
# 支持:对象数组、数组的数组、表头+行格式
edit - 编辑单元格值或公式
python3 scripts/excel.py edit file.xlsx A1 "New Value"
python3 scripts/excel.py edit file.xlsx B2 100
python3 scripts/excel.py edit file.xlsx C3 "SUM(A1:B2)" --formula
python3 scripts/excel.py edit file.xlsx D4 "=VLOOKUP(A1,Data!A:B,2,FALSE)" --formula
find - 搜索文本
python3 scripts/excel.py find file.xlsx "search term"
python3 scripts/excel.py find file.xlsx "error" --sheet "Log"
# 返回:包含该文本的单元格列表
replace - 查找并替换
python3 scripts/excel.py replace file.xlsx "old" "new"
python3 scripts/excel.py replace file.xlsx "2024" "2025" --sheet "Dates"
add-sheet - 添加新工作表
python3 scripts/excel.py add-sheet file.xlsx "NewSheet"
python3 scripts/excel.py add-sheet file.xlsx "First" --position 0 # 插入到开头
rename-sheet - 重命名工作表
python3 scripts/excel.py rename-sheet file.xlsx "Sheet1" "Data"
delete-sheet - 删除工作表
python3 scripts/excel.py delete-sheet file.xlsx "OldSheet"
copy-sheet - 复制工作表
python3 scripts/excel.py copy-sheet file.xlsx "Template" "January"
insert-rows - 插入行
python3 scripts/excel.py insert-rows file.xlsx 5 # 在第 5 行插入 1 行
python3 scripts/excel.py insert-rows file.xlsx 5 --count 3 # 插入 3 行
insert-cols - 插入列
python3 scripts/excel.py insert-cols file.xlsx C # 在 C 列插入
python3 scripts/excel.py insert-cols file.xlsx 3 --count 2 # 在位置 3 插入 2 列
delete-rows - 删除行
python3 scripts/excel.py delete-rows file.xlsx 5
python3 scripts/excel.py delete-rows file.xlsx 5 --count 3
delete-cols - 删除列
python3 scripts/excel.py delete-cols file.xlsx C
python3 scripts/excel.py delete-cols file.xlsx B --count 2
merge - 合并单元格
python3 scripts/excel.py merge file.xlsx A1:C1
python3 scripts/excel.py merge file.xlsx A1:A5 --sheet "Header"
unmerge - 取消合并单元格
python3 scripts/excel.py unmerge file.xlsx A1:C1
format - 应用单元格格式
# 粗体和斜体
python3 scripts/excel.py format file.xlsx A1:D1 --bold --italic
# 字体设置
python3 scripts/excel.py format file.xlsx A1:D1 --font-size 14 --font-color RED --font-name "Arial"
# 背景颜色
python3 scripts/excel.py format file.xlsx A1:D1 --bg-color YELLOW
# 对齐方式
python3 scripts/excel.py format file.xlsx A:A --align center --valign top
# 文本换行
python3 scripts/excel.py format file.xlsx B2:B100 --wrap
# 边框
python3 scripts/excel.py format file.xlsx A1:D10 --border thin
# 边框样式:thin, medium, thick, double
# 组合格式
python3 scripts/excel.py format file.xlsx A1:D1 --bold --bg-color "#4472C4" --font-color WHITE --align center
resize - 调整行和列的大小
python3 scripts/excel.py resize file.xlsx --row 1:30 # 第 1 行高度 = 30
python3 scripts/excel.py resize file.xlsx --col A:20 # A 列宽度 = 20
python3 scripts/excel.py resize file.xlsx --row 1:30 --col A:15 --col B:25
freeze - 冻结窗格
python3 scripts/excel.py freeze file.xlsx A2 # 冻结第 1 行
python3 scripts/excel.py freeze file.xlsx B1 # 冻结 A 列
python3 scripts/excel.py freeze file.xlsx B2 # 冻结第 1 行和 A 列
to-csv - 导出为 CSV
python3 scripts/excel.py to-csv file.xlsx output.csv
python3 scripts/excel.py to-csv file.xlsx data.csv --sheet "Data"
to-json - 导出为 JSON(第一行作为表头)
python3 scripts/excel.py to-json file.xlsx output.json
# 输出:[{"Header1": "val1", "Header2": "val2"}, ...]
to-markdown - 导出为 Markdown 表格
python3 scripts/excel.py to-markdown file.xlsx
python3 scripts/excel.py to-markdown file.xlsx --sheet "Summary"
命名颜色:RED, GREEN, BLUE, YELLOW, WHITE, BLACK, GRAY, ORANGE, PURPLE, PINK, CYAN
十六进制颜色:#FF0000, #4472C4, 00FF00(带或不带 #)
# 用数据创建工作簿
python3 scripts/excel.py from-json sales.json report.xlsx --sheet "Sales"
# 格式化表头
python3 scripts/excel.py format report.xlsx A1:E1 --bold --bg-color "#4472C4" --font-color WHITE
# 冻结表头行
python3 scripts/excel.py freeze report.xlsx A2
# 调整列宽
python3 scripts/excel.py resize report.xlsx --col A:15 --col B:25 --col C:12
# 添加新行
python3 scripts/excel.py insert-rows report.xlsx 2
python3 scripts/excel.py write report.xlsx --data '[["New Item", 100, 50]]' --start A2
# 更新特定单元格
python3 scripts/excel.py edit report.xlsx D10 "=SUM(D2:D9)" --formula
# 查找并替换日期
python3 scripts/excel.py replace report.xlsx "2024" "2025"
# 以 JSON 格式读取以便处理
python3 scripts/excel.py read data.xlsx --format json > data.json
# 以 Markdown 格式读取特定范围
python3 scripts/excel.py read data.xlsx --range A1:D20 --format markdown
# 将特定工作表导出为 CSV
python3 scripts/excel.py to-csv data.xlsx --sheet "Raw Data" export.csv
所有命令输出带有 success: true/false 的 JSON:
{
"success": true,
"file": "report.xlsx",
"sheet": "Sheet1",
...
}
使用 read 命令时,可通过 --format markdown 或 --format csv 获取替代输出格式。
每周安装次数
74
代码仓库
GitHub 星标数
528
首次出现
2026年2月7日
安全审计
安装于
codex71
opencode71
cursor71
gemini-cli70
amp70
cline70
Comprehensive Excel file manipulation - read, write, edit, format, and export.
pip install openpyxl
# Or use uv (recommended)
uv run --with openpyxl python3 scripts/excel.py --help
cd skills/excel
# Get file info
python3 scripts/excel.py info report.xlsx
# Read entire sheet
python3 scripts/excel.py read report.xlsx
python3 scripts/excel.py read report.xlsx --format markdown
python3 scripts/excel.py read report.xlsx --sheet "Sales" --range A1:D10
# Read specific cell
python3 scripts/excel.py cell report.xlsx B5
# Create new workbook
python3 scripts/excel.py create output.xlsx
python3 scripts/excel.py create output.xlsx --sheets "Data,Summary,Charts"
# Write data
python3 scripts/excel.py write output.xlsx --data '[[1,2,3],[4,5,6]]'
python3 scripts/excel.py write output.xlsx --data '{"headers":["Name","Age"],"rows":[["Alice",30],["Bob",25]]}'
# Edit a cell
python3 scripts/excel.py edit report.xlsx A1 "New Value"
python3 scripts/excel.py edit report.xlsx B2 "SUM(A1:A10)" --formula
# Export
python3 scripts/excel.py to-csv report.xlsx output.csv
python3 scripts/excel.py to-json report.xlsx output.json
python3 scripts/excel.py to-markdown report.xlsx
info - Get workbook metadata
python3 scripts/excel.py info report.xlsx
# Returns: sheets, dimensions, row/column counts
read - Read sheet data
python3 scripts/excel.py read file.xlsx # JSON output
python3 scripts/excel.py read file.xlsx --format csv # CSV output
python3 scripts/excel.py read file.xlsx --format markdown # Markdown table
python3 scripts/excel.py read file.xlsx --sheet "Sheet2" # Specific sheet
python3 scripts/excel.py read file.xlsx --range A1:D10 # Specific range
cell - Read a specific cell
python3 scripts/excel.py cell file.xlsx A1
python3 scripts/excel.py cell file.xlsx B5 --sheet "Data"
# Returns: value, formula (if any), data type, merge status
create - Create new workbook
python3 scripts/excel.py create new.xlsx
python3 scripts/excel.py create new.xlsx --sheets "Sheet1,Sheet2,Summary"
write - Write data to cells
# 2D array
python3 scripts/excel.py write file.xlsx --data '[[1,2,3],[4,5,6]]'
# With headers
python3 scripts/excel.py write file.xlsx --data '{"headers":["A","B"],"rows":[[1,2],[3,4]]}'
# Start at specific cell
python3 scripts/excel.py write file.xlsx --data '[[1,2]]' --start C5
# Key-value pairs
python3 scripts/excel.py write file.xlsx --data '{"Name":"Alice","Age":30}'
from-csv - Create Excel from CSV
python3 scripts/excel.py from-csv data.csv output.xlsx
python3 scripts/excel.py from-csv data.csv output.xlsx --sheet "Imported"
from-json - Create Excel from JSON
python3 scripts/excel.py from-json data.json output.xlsx
# Supports: array of objects, array of arrays, headers+rows format
edit - Edit a cell value or formula
python3 scripts/excel.py edit file.xlsx A1 "New Value"
python3 scripts/excel.py edit file.xlsx B2 100
python3 scripts/excel.py edit file.xlsx C3 "SUM(A1:B2)" --formula
python3 scripts/excel.py edit file.xlsx D4 "=VLOOKUP(A1,Data!A:B,2,FALSE)" --formula
find - Search for text
python3 scripts/excel.py find file.xlsx "search term"
python3 scripts/excel.py find file.xlsx "error" --sheet "Log"
# Returns: list of cells containing the text
replace - Find and replace
python3 scripts/excel.py replace file.xlsx "old" "new"
python3 scripts/excel.py replace file.xlsx "2024" "2025" --sheet "Dates"
add-sheet - Add a new sheet
python3 scripts/excel.py add-sheet file.xlsx "NewSheet"
python3 scripts/excel.py add-sheet file.xlsx "First" --position 0 # Insert at beginning
rename-sheet - Rename a sheet
python3 scripts/excel.py rename-sheet file.xlsx "Sheet1" "Data"
delete-sheet - Delete a sheet
python3 scripts/excel.py delete-sheet file.xlsx "OldSheet"
copy-sheet - Copy a sheet
python3 scripts/excel.py copy-sheet file.xlsx "Template" "January"
insert-rows - Insert rows
python3 scripts/excel.py insert-rows file.xlsx 5 # Insert 1 row at row 5
python3 scripts/excel.py insert-rows file.xlsx 5 --count 3 # Insert 3 rows
insert-cols - Insert columns
python3 scripts/excel.py insert-cols file.xlsx C # Insert at column C
python3 scripts/excel.py insert-cols file.xlsx 3 --count 2 # Insert 2 cols at position 3
delete-rows - Delete rows
python3 scripts/excel.py delete-rows file.xlsx 5
python3 scripts/excel.py delete-rows file.xlsx 5 --count 3
delete-cols - Delete columns
python3 scripts/excel.py delete-cols file.xlsx C
python3 scripts/excel.py delete-cols file.xlsx B --count 2
merge - Merge cells
python3 scripts/excel.py merge file.xlsx A1:C1
python3 scripts/excel.py merge file.xlsx A1:A5 --sheet "Header"
unmerge - Unmerge cells
python3 scripts/excel.py unmerge file.xlsx A1:C1
format - Apply cell formatting
# Bold and italic
python3 scripts/excel.py format file.xlsx A1:D1 --bold --italic
# Font settings
python3 scripts/excel.py format file.xlsx A1:D1 --font-size 14 --font-color RED --font-name "Arial"
# Background color
python3 scripts/excel.py format file.xlsx A1:D1 --bg-color YELLOW
# Alignment
python3 scripts/excel.py format file.xlsx A:A --align center --valign top
# Text wrapping
python3 scripts/excel.py format file.xlsx B2:B100 --wrap
# Borders
python3 scripts/excel.py format file.xlsx A1:D10 --border thin
# Border styles: thin, medium, thick, double
# Combined
python3 scripts/excel.py format file.xlsx A1:D1 --bold --bg-color "#4472C4" --font-color WHITE --align center
resize - Resize rows and columns
python3 scripts/excel.py resize file.xlsx --row 1:30 # Row 1 height = 30
python3 scripts/excel.py resize file.xlsx --col A:20 # Column A width = 20
python3 scripts/excel.py resize file.xlsx --row 1:30 --col A:15 --col B:25
freeze - Freeze panes
python3 scripts/excel.py freeze file.xlsx A2 # Freeze row 1
python3 scripts/excel.py freeze file.xlsx B1 # Freeze column A
python3 scripts/excel.py freeze file.xlsx B2 # Freeze row 1 and column A
to-csv - Export to CSV
python3 scripts/excel.py to-csv file.xlsx output.csv
python3 scripts/excel.py to-csv file.xlsx data.csv --sheet "Data"
to-json - Export to JSON (first row as headers)
python3 scripts/excel.py to-json file.xlsx output.json
# Outputs: [{"Header1": "val1", "Header2": "val2"}, ...]
to-markdown - Export to markdown table
python3 scripts/excel.py to-markdown file.xlsx
python3 scripts/excel.py to-markdown file.xlsx --sheet "Summary"
Named colors: RED, GREEN, BLUE, YELLOW, WHITE, BLACK, GRAY, ORANGE, PURPLE, PINK, CYAN
Hex colors: #FF0000, #4472C4, 00FF00 (with or without #)
# Create workbook with data
python3 scripts/excel.py from-json sales.json report.xlsx --sheet "Sales"
# Format headers
python3 scripts/excel.py format report.xlsx A1:E1 --bold --bg-color "#4472C4" --font-color WHITE
# Freeze header row
python3 scripts/excel.py freeze report.xlsx A2
# Resize columns
python3 scripts/excel.py resize report.xlsx --col A:15 --col B:25 --col C:12
# Add new row
python3 scripts/excel.py insert-rows report.xlsx 2
python3 scripts/excel.py write report.xlsx --data '[["New Item", 100, 50]]' --start A2
# Update specific cell
python3 scripts/excel.py edit report.xlsx D10 "=SUM(D2:D9)" --formula
# Find and replace dates
python3 scripts/excel.py replace report.xlsx "2024" "2025"
# Read as JSON for processing
python3 scripts/excel.py read data.xlsx --format json > data.json
# Read specific range as markdown
python3 scripts/excel.py read data.xlsx --range A1:D20 --format markdown
# Export specific sheet to CSV
python3 scripts/excel.py to-csv data.xlsx --sheet "Raw Data" export.csv
All commands output JSON with success: true/false:
{
"success": true,
"file": "report.xlsx",
"sheet": "Sheet1",
...
}
Use --format markdown or --format csv with read command for alternative output.
Weekly Installs
74
Repository
GitHub Stars
528
First Seen
Feb 7, 2026
Security Audits
Gen Agent Trust HubFailSocketPassSnykPass
Installed on
codex71
opencode71
cursor71
gemini-cli70
amp70
cline70
通过 LiteLLM 代理让 Claude Code 对接 GitHub Copilot 运行 | 高级变通方案指南
44,900 周安装