parse-docx is a bounded, dependency-free DOCX parser for Python 3.14+.
It reads the Office Open XML package without executing or resolving document
content and returns an immutable, source-part-aware document model.
from parse_docx import load
document = load("report.docx")
print(document.text)
for block in document.blocks:
print(block.source_part, block)
The model preserves paragraph and table order, run formatting, common heading
styles, basic list numbering, and inert hyperlink targets. Headers, footers,
footnotes, and endnotes are available separately. Document.text provides a
safe plain-text projection of the body.
See supported features and security boundaries for parsing details, limits, and unsupported content.
uv sync --locked
uv run --frozen python -W error::ResourceWarning -m pytest -q
uv run --frozen python scripts/check_distribution.py --output-dir dist
The distribution is named parse-docx; the Python import package is
parse_docx.
See release instructions for Trusted Publishing setup.