docx2txt
A pure python-based utility to extract text and images from docx files.
What it is and what it does
docx2txt is a pure-Python utility that reads Microsoft Word .docx files and extracts their text content, along with headers, footers, hyperlinks, and embedded images. It provides both a command-line tool and a Python API, making it usable in scripts or as part of a larger application. The package has no runtime dependencies, so installation is lightweight and friction-free.
The code is adapted from existing docx tooling but focuses specifically on text and image extraction rather than document manipulation. It's positioned as a simpler alternative when you only need to pull content out of .docx files rather than create or modify them. With significant real-world use, though maintenance is infrequent (last update 508 days ago).
Use it for:
- Batch-process Word documents to extract text for indexing, search, or archival systems.
- Automate extraction of images embedded in .docx files for asset management or document scanning workflows.
- Build a document ingestion pipeline that converts .docx content into plain text for NLP or analysis tasks.
- Extract header and footer content from formal documents for metadata or compliance auditing.
- Command-line tool for one-off conversion of .docx files to text without opening Word.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Extracts text, headers, footers, hyperlinks, and images from Microsoft Word .docx files using pure Python, with both command-line and programmatic interfaces.
Yes, if you need straightforward .docx text and image extraction and can verify the license terms. The package is mature, has no dependencies, and handles the core task well. The aging maintenance status and unclear license are minor concerns—check the repository for the actual license before using in production, and test with your specific .docx variants to confirm compatibility.
Install
docx2txt on PyPI
pip
pip install docx2txtuv
uv add docx2txtpoetry
poetry add docx2txtInstalling docx2txt
Before you install
Installation is straightforward with no runtime dependencies. The package is aging (last release 508 days ago) but the repository remains active and unarchived, suggesting maintenance is infrequent rather than abandoned.
License in practice
License status is unclear—no SPDX identifier or raw license text is available in the package metadata. You should verify the actual license terms in the repository before relying on this package in a commercial or copyleft-sensitive context.
Quickstart
pip install docx2txt
import docx2txt
# Extract text from a .docx file
text = docx2txt.process("file.docx")
# Extract text and save images to a directory
text = docx2txt.process("file.docx", "/tmp/img_dir")
Verify before relying
- Whether the package handles all .docx file variants and edge cases reliably.
- Exact license terms and any attribution requirements from the adapted code.
- Python version compatibility (requires_python is unspecified in metadata).
- Performance characteristics with large or complex .docx documents.
Package facts
| License | not declared (unclear) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | aging — 508 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 8,581,646/month — #1,604 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: docx2txt-0.9-py3-none-any.whl
Keywords: python, docx, text, images, extract
Tags
More Text Processing packages
A drop-in replacement for Python's standard…
permissive · top 100 on PyPI
pyparsingpyparsing provides a library for building text…
permissive · top 1,000 on PyPI
docutilsDocutils converts plaintext documentation in…
unclear · top 1,000 on PyPI
RapidFuzzRapidFuzz provides fast fuzzy string matching…
permissive · top 1,000 on PyPI
tinycss2tinycss2 parses CSS strings into token and…
permissive · top 1,000 on PyPI
llama-parseLlamaParse parses complex documents (PDFs,…
permissive · top 1,000 on PyPI
docx2pythonExtracts text, images, headers, footers,…
permissive · top 15,000 on PyPI
htmldocxConverts HTML content into Microsoft Word…
permissive · top 5,000 on PyPI
docxCreates, reads, and writes Microsoft Office…
unclear · top 15,000 on PyPI
spire-docSpire.Doc creates, reads, modifies, and…
unclear · top 15,000 on PyPI
pdf2docxConverts PDF files to Word documents (.docx…
permissive · top 5,000 on PyPI
textractExtracts text from documents in multiple…
permissive · top 15,000 on PyPI
html-for-docxConverts HTML content to Word documents…
permissive · top 15,000 on PyPI
docxtplGenerates Word documents (.docx) from templates…
copyleft · top 5,000 on PyPI
html2docxConverts valid HTML to Microsoft Word (.docx)…
permissive · top 15,000 on PyPI
python-docxpython-docx reads, creates, and modifies…
permissive · top 1,000 on PyPI