Doc Reader
Office files are ZIPs of XML. This reads them with the stdlib, so an agent can work with documents on any machine with zero installs.
Commands
python3 scripts/doc_reader.py report.docx
python3 scripts/doc_reader.py slides.pptx --json
python3 scripts/doc_reader.py data.xlsx | head -50
python3 scripts/doc_reader.py page.html notes.md book.pdf
Supported formats
| Format | How | Notes |
|---|---|---|
.docx |
ZIP + word/document.xml paragraphs | headings preserved as paragraphs |
.pptx |
ZIP + ppt/slides/slideN.xml | per-slide text, slide count |
.xlsx |
ZIP + shared strings + sheet rows | tab-separated rows |
.html/.htm |
html.parser, scripts/styles stripped | clean readable text |
.md/.txt |
raw text | passthrough |
.pdf |
delegates to pdftotext |
honest error if not installed |
Exit codes
0 = all files read, 1 = some failed, 2 = all failed or unsupported format. Corrupt files (bad ZIP, malformed XML) are reported as corrupt, not silently skipped.
Pairs with
resume-audit (convert a PDF resume with doc-reader first, then audit),
seo-audit (read the HTML doc-reader extracts, then score it).