In Claude (connector)install_skill("excel-to-python")
CLIlendskill install excel-to-python
SKILL.md
---
name: excel-to-python
description: Convert spreadsheet logic (formulas, lookups, pivots, macros) into clean, tested Python/pandas code and prove the outputs match the original workbook. Use for automating Excel reports, migrating spreadsheets to Python, or 'turn this Excel into a script'.
license: Proprietary — Lendskill original
---
# Excel → Python
## 1. Read the workbook
List sheets, named ranges, and formula cells (openpyxl with `data_only=False` shows formulas). Map the flow: inputs → calculation sheets → outputs. Note VLOOKUP/XLOOKUP, SUMIFS, pivots, and any VBA.
## 2. Rebuild step by step
One function per logical step, named after what it computes. Lookups → `merge` (check join keys are unique where Excel assumed so); SUMIFS → `groupby`/boolean masks; pivots → `pivot_table`. Keep the user's names for columns and sheets.
## 3. Watch the traps
Excel rounding vs float; blanks vs zeros; text-numbers ("0123"); dates stored as serial numbers; case-insensitive matching in lookups; approximate-match VLOOKUP (TRUE) behaves like a sorted range lookup.
## 4. Prove it
Run on the same inputs and compare every output cell/column against the workbook's computed values (tolerance for float). Report any mismatch and its cause.
## 5. Deliver
The script (CLI with input/output paths), a test that runs the comparison, and a short README.
## Output format
- A Python script (pandas) reproducing every sheet calculation, with the formula it replaces in a comment
- A check that compares the script's results to the original workbook
- Run instructions and dependencies