Doc Reader

Extracts plain text from office and web documents with zero dependencies — docx, pptx, xlsx, html, markdown, and plain text, using only Python's stdlib (zipfile + xml.etree). No LibreOffice, no python-docx, no network. PDF delegates to pdftotext when installed, reporting honestly when it is not. Use when an agent needs to read, summarize, or compare documents without installing document tooling.

trac3r00 3c8b8d0 2 files · 8.1 KB Updated

File contents

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).

trac3r00/agent-skills/tree/main/skills/doc-reader commit 3c8b8d00f3

Frequently asked questions

npx skillmds@latest add trac3r00/doc-reader