Excel work has a way of eating entire afternoons: twelve monthly workbooks to merge, a sheet per month to split back out, formulas that break the moment the file touches pandas or a BI tool. These four command-line tools (openpyxl is the only dependency) do the boring versions of those jobs.
1. Summarize a workbook before opening it
python xlsx_summary.py report.xlsx
Prints rows, columns and a header preview per sheet. For a folder of workbooks, it's the fastest "what am I even looking at" pass.
2. Merge monthly workbooks — with a header contract
xlsx_merge.py refuses files whose columns don't match (silently stacked mis-aligned exports are how data goes wrong), tolerates trailing empty header cells, and can tag every row with its source file:
python xlsx_merge.py year.xlsx jan.xlsx feb.xlsx mar.xlsx --add-source
3. One file per sheet
python xlsx_split_sheets.py big.xlsx
Each sheet becomes its own workbook — handy when downstream tools want single sheets.
4. Flatten formulas to values
The classic "why is this cell empty in pandas" problem: formulas have no cached value until Excel recalculates. xlsx_values.py writes a formula-free copy:
python xlsx_values.py report.xlsx
The take
The tools are tiny on purpose: each maps to one flag, one transformation, and always prints what it changed. If a script's output can't be audited in five seconds, it's not automation — it's a liability.
What's next: I'm bundling these (plus the CSV cleanup tools from my previous post) into downloadable toolkits with READMEs and a money-back guarantee. I'll link them here as soon as they're live — drop a comment if you want a ping.
Questions about gnarly .xlsx edge cases? Ask in the comments.
Top comments (0)