docx-parse-resilient
Installation
SKILL.md
Resilient DOCX Text Extraction
Extract text from Microsoft Word (.docx) files using a robust two-tier approach: shell-based extraction as the primary method, with Python zipfile fallback when shell commands fail or return no output.
When to Use
- Python environment may lack
python-docxbutzipfilemodule is available (standard library) - Working in constrained or inconsistent environments (containers, minimal images, CI/CD)
- Shell
unzipcommand returns errors or no output - Need reliable extraction with automatic fallback
Core Technique
DOCX files are ZIP archives containing XML files. This skill provides two extraction methods:
- Primary (Shell):
unzip -p+sedfor fast extraction - Fallback (Python):
zipfilemodule for reliable extraction when shell fails