Institution Spreadsheet Update
Update institution data in Excel/CSV files, highlight changes in red font, and deliver a PDF change report.
Quick start
- Confirm input: user-selected
.csv/.xlsxpath(s). If multiple files, process each independently. - Read schema: first row = headers. Identify key column (
school_idpreferred; elseschool_name_en/school_name_zh). - Research & update: for each institution row, verify every non-metadata column against official sources. See reference.md.
- Build changes JSON (see format below). Only include cells whose normalized value actually changed.
- Apply & report:
python3 -m pip install openpyxl fpdf2 python ~/.cursor/skills/institution-spreadsheet-update/scripts/apply_updates_and_report.py \ --input "/path/to/table.csv" \ --changes "/path/to/changes.json" \ --output-dir "/same/folder/as/input" - Deliver to user:
{stem}_updated_{YYYYMMDD}.xlsx— full table, changed cells in red{stem}_updated_{YYYYMMDD}.csv— plain CSV mirror (no color){stem}_update_report_{YYYYMMDD}.pdf— Chinese change summary{stem}_changes_{YYYYMMDD}.json— machine-readable diff (saved alongside)
Workflow checklist
- [ ] Input file(s) confirmed
- [ ] Baseline captured (current cell values)
- [ ] Each school researched from official / primary sources
- [ ] changes.json written
- [ ] apply_updates_and_report.py executed successfully
- [ ] PDF + highlighted XLSX paths reported to user
Changes JSON format
Write an array of per-school objects:
[
{
"school_id": "stanford",
"school_name_en": "Stanford University",
"school_name_zh": "斯坦福大学",
"changes": [
{
"field": "test_policy",
"label_zh": "标化政策",
"old": "optional",
"new": "required"
}
]
}
]
Rules:
fieldmust match the spreadsheet header exactly.label_zh= human-readable column name for the PDF (use reference.md mapping when available).- Treat empty,
—,N/A, whitespace-only as equivalent when comparing. - Always add/update
last_updated→ today's date (YYYY-MM-DD) when any field changes. - Do not list unchanged fields.
Research rules
- Primary sources first: official admissions / international-student pages.
- One school at a time — do not batch-guess across schools.
- Record evidence in
source_urlandsource_noteswhen those columns exist. - Put concise Chinese context in
notes_zhwhen policy wording is nuanced. - If a field cannot be verified, leave the old value and note it under
## 未能核实in the PDF (viaunverifiedarray in JSON — see script--changesextended format).
Extended changes file (optional):
{
"checked_at": "2026-06-17",
"schools": [ /* same as above */ ],
"unverified": [
{"school_id": "foo", "field": "toefl_min_ibt", "reason": "官网未标明最低分"}
]
}
Output conventions
| Artifact | Naming | Notes |
|---|---|---|
| Highlighted workbook | {stem}_updated_{date}.xlsx |
Red font (#FF0000) on changed cells only |
| Updated CSV | {stem}_updated_{date}.csv |
Same data, UTF-8 with BOM |
| PDF report | {stem}_update_report_{date}.pdf |
Chinese summary; see template below |
| Changes JSON | {stem}_changes_{date}.json |
Archive for next diff |
All outputs go in --output-dir (default: same folder as input).
PDF report structure
The script renders:
- 封面摘要 — 检查日期、文件路径、院校总数、变更院校数、变更字段总数
- 变更详情 — per school: 中英校名 + table (
字段 | 旧值 | 新值) - 变更解读 — agent-written
summary_zhbullets (pass via--summary-mdor embed in changes JSON as"summary_zh": ["..."]) - 未能核实 — optional unverified list
After the script runs, always add 2–5 bullets of plain-language summary_zh interpretation (policy trends, deadline shifts, testing changes) before handing off to the user.
Multiple files
When the user selects several spreadsheets (e.g. top30.csv, lac_top20.csv):
- Process each file separately (own changes JSON + outputs).
- Optionally merge PDFs or provide one combined
--summary-mdcovering cross-file trends.
Metadata columns (auto-handling)
These columns are updated by the pipeline but not highlighted in red:
last_updated— set to check date when any other field changes
Dependencies
python3 -m pip install openpyxl fpdf2
PDF Chinese rendering uses macOS PingFang.ttc or STHeiti Light.ttc when available; falls back to bundled font path via --font.
Additional resources
- Column labels & research priorities: reference.md