返回顶部
e

excel-builder

Build .xlsx files with formulas, merged cells, data validation, conditional formatting, pivot tables, and charts. Use when creating Excel spreadsheets, financial tables, data entry forms, or any structured .xlsx deliverable requiring formulas or formatting.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
71
下载量
0
收藏
概述
安装方式
版本历史

excel-builder

# Excel Builder Builds structured `.xlsx` files programmatically using Python libraries (openpyxl or xlsxwriter). ## When to Use This Skill - Creating Excel spreadsheets with formulas and calculated fields - Building financial tables, budgets, or invoices - Generating data entry forms with validation and dropdowns - Producing reports with charts (bar, line, pie, scatter) - Exporting structured data with conditional formatting or color coding - Building pivot-ready data tables ## Core Workflow 1. **Choose library** — Use `openpyxl` for reading/modifying existing files; use `xlsxwriter` for new write-only files with rich charts 2. **Design structure** — Define sheets, columns, headers, and data rows before writing 3. **Write data** — Populate cells row by row; apply number formats (`"#,##0.00"`, `"YYYY-MM-DD"`) 4. **Add formulas** — Use Excel formula strings: `=SUM(B2:B100)`, `=IF(A2>0, "Yes", "No")` 5. **Format** — Apply styles: bold headers, column widths, merged cells, fill colors, borders 6. **Validate** — Add data validation (dropdown lists, numeric ranges) where applicable 7. **Charts** — Add charts referencing data ranges; set titles and axis labels 8. **Save and verify** — Save to output path; confirm file exists and is non-zero bytes ## Key Patterns ### openpyxl (read/write existing) ```python from openpyxl import Workbook, load_workbook from openpyxl.styles import Font, PatternFill, Alignment wb = Workbook() ws = wb.active ws.title = "Report" ws["A1"] = "Revenue" ws["A1"].font = Font(bold=True, size=12) ws.column_dimensions["A"].width = 20 wb.save("output.xlsx") ``` ### xlsxwriter (new files with charts) ```python import xlsxwriter wb = xlsxwriter.Workbook("output.xlsx") ws = wb.add_worksheet("Summary") bold = wb.add_format({"bold": True, "bg_color": "#4472C4", "font_color": "white"}) ws.write("A1", "Month", bold) chart = wb.add_chart({"type": "column"}) chart.add_series({"values": "=Summary!$B$2:$B$13", "name": "Revenue"}) ws.insert_chart("D2", chart) wb.close() ``` ## Error Handling - If `openpyxl` not installed: `pip install openpyxl` - If `xlsxwriter` not installed: `pip install xlsxwriter` - Always wrap `wb.save()` in try/except; report path conflicts - Verify output with `os.path.getsize(path) > 0` before returning ## Output Return the absolute path to the saved `.xlsx` file. If generating multiple sheets, list each sheet name and row count in a brief summary.

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 excel-builder-1775959443 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 excel-builder-1775959443 技能

通过命令行安装

skillhub install excel-builder-1775959443

下载 Zip 包

⬇ 下载 excel-builder v1.0.0

文件大小: 2.09 KB | 发布时间: 2026-4-13 10:12

v1.0.0 最新 2026-4-13 10:12
Initial release of excel-builder.

- Build .xlsx files with formulas, merged cells, data validation, conditional formatting, pivot tables, and charts.
- Supports both openpyxl (read/write existing files) and xlsxwriter (create new files with advanced charting).
- Designed for generating structured spreadsheets, financial tables, data entry forms, and formatted reports.
- Offers output validation, example usage patterns, and installation/error handling guidance.
- Returns absolute path to generated .xlsx file and summary of included sheets.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部