Best way to extract text from a Word doc without using COM/automation?
<p>Is there a reasonable way to extract plain text from a Word file that doesn't depend on COM automation?  (This is a a feature for a web app deployed on a non-Windows platform - that's non-negotiable in this case.)</p>

<p>Antiword seems like it might be a reasonable option, but it seems like it might be abandoned.</p>

<p>A Python solution would be ideal, but doesn't appear to be available.</p>

<p>(Same answer as <a href="http://stackoverflow.com/questions/125222/extracting-text-from-ms-word-files-in-python">extracting text from MS word files in python</a>)</p>

<p>Use the native Python docx module which I made this week. Here's how to extract all the text from a doc:</p>

<pre><code>document = opendocx('Hello world.docx')

# This location is where most document content lives 
docbody = document.xpath('/w:document/w:body', namespaces=wordnamespaces)[0]

# Extract all text
print getdocumenttext(document)
</code></pre>

<p>See <a href="https://python-docx.readthedocs.org/en/latest/">Python DocX site</a></p>

<p>100% Python, no COM, no .net, no Java, no parsing serialized XML with regexs, no crap.</p>
