Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Excel Pretty — Claude Skill for Financial-Grade Excel Reports

把数据型 Excel 美化成可直接交付给老板/客户的成品报表。金融表格标准:深蓝主色 + 三线表 + Times New Roman 数字 + 克制配色。

用法

零配置(推荐)

# 给 csv / xlsx,自动推断格式 + 自动找 highlight_max
.venv/bin/python -m scripts.excel_pretty pretty \
    --input your_data.csv \
    --output pretty.xlsx

高级用法

# 1. 安装
git clone https://github.com/zhouivvy1-blip/excel-pretty.git
cd excel-pretty
./install.sh

# 2. 美化(显式指定 preset 和 spec)
.venv/bin/python -m scripts.excel_pretty pretty \
    --input your_data.csv \
    --output pretty.xlsx \
    --preset navy \
    --spec examples/specs/sales_daily.json

# 3. 批量处理目录下所有 csv
.venv/bin/python -m scripts.excel_pretty batch \
    --input-dir ./daily_reports --output-dir ./pretty --pattern "*.csv"

内置 spec 模板

模板 用途
examples/specs/sales_daily.json 销售日报(日期/渠道/GMV/订单数/客单价/环比 + GMV 趋势线)
examples/specs/campaign.json 营销活动复盘(柱状图对比渠道 + 趋势线看 ROI)
examples/specs/kpi_with_cards.json KPI 完成情况(完成率 max 高亮 + 顶部 4 个 KPI 卡)

复制一份改字段名即可。

内置预设

预设 主色 适用
navy ⭐默认 #0B2545 海军蓝 金融/法务/合规
minimal_business #1F4E79 深蓝 对外汇报/跨部门
steel_blue #2C5F7E 钢蓝 制造业/工业
executive_burgundy #7B2D26 酒红 高管汇报/年度战略
warm_chocolate #5D4037 暖棕 传统行业/咨询
deep_purple #4A2D5E 深紫 律所/咨询/创意
graphite #424242 石墨灰 学术/技术/打印
forest_green #2E5E3E 森林绿 环保/能源/ESG

核心规则(金融表格标准)

  • 单 sheet 颜色 ≤ 7,字体 ≤ 3
  • 数字右对齐,文字左对齐,表头居中
  • 三线表(顶/表头下/底,内部无线)
  • 隔行底色(极淡同色系)
  • 标题 12–14 号,表头 11,正文 10
  • 中文微软雅黑 + 数字 Times New Roman
  • 千分位 / 百分比 / 日期格式统一
  • 条件格式慎用(仅用于"完成率"最大值高亮等关键场景)

spec JSON 示例

{
  "sheets": [{
    "name": "kpi_data",
    "role": "data",
    "columns": [
      {"name": "指标", "format": "text"},
      {"name": "完成率", "format": "percent", "highlight_max": true}
    ]
  }]
}

命令清单

# 美化(自动推断 spec,无需手写)
python -m scripts.excel_pretty pretty -i in.csv -o out.xlsx [-p preset]

# 美化(显式 spec)
python -m scripts.excel_pretty pretty -i in.csv -o out.xlsx [-p preset] [-s spec.json]

# 批量美化
python -m scripts.excel_pretty batch --input-dir <d> --output-dir <d> [--pattern "*.csv"]

# 自动生成 spec(可手动修改后再喂给 pretty)
python -m scripts.excel_pretty infer-spec -i in.csv [-o spec.json]

# 诊断
python -m scripts.excel_pretty inspect -i in.xlsx

# 列出预设
python -m scripts.excel_pretty list-presets

# 验证样式(可选 --spec 检查列名匹配)
python -m scripts.excel_pretty verify -i out.xlsx [--spec spec.json]

在 Claude Code 中使用

直接说"用 excel-pretty 美化这个文件",Claude 会自动调用本 skill。

License

MIT

About

金融表格标准 Excel 美化 Claude skill — 7 套配色、三线表、TNR 数字、完成率最大值高亮

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages