officemd
Fast Office document extraction for LLMs and agents. Converts DOCX, XLSX, CSV, PPTX, and PDF into clean markdown, structured JSON IR, and Docling output.
Install
uv add officemd
# or
pip install officemd
For the CLI without adding to a project:
uvx officemd markdown report.docx
CLI
officemd markdown report.docx
officemd markdown budget.xlsx --sheets "Summary,Q1"
officemd render report.docx
officemd diff old.docx new.docx
SDK
from pathlib import Path
from officemd import extract_ir_json, markdown_from_bytes, docling_from_bytes
content = Path("report.docx").read_bytes()
# Markdown
print(markdown_from_bytes(content, format="docx"))
# Structured JSON IR
print(extract_ir_json(content, format="docx"))
# Docling JSON
print(docling_from_bytes(content, format="docx"))
Typed OOXML patching with reports
import officemd
from pathlib import Path
content = Path("report.docx").read_bytes()
patch = officemd.DocxPatch(
scoped_replacements=[
officemd.ScopedDocxReplace(
officemd.DocxTextScope.ALL_TEXT,
officemd.TextReplace("word", "term"),
)
]
)
# ALL_TEXT includes document content plus free-text metadata/app/custom fields.
single = officemd.patch_docx_with_report(content, patch)
print(single.report.replacements_applied)
batch = officemd.patch_docx_batch_with_report([content, content], patch, workers=4)
for item in batch:
print(item.report.parts_scanned, item.report.parts_modified, item.report.replacements_applied)
Additional patch scopes are available for free-text metadata/comment fields:
DocxTextScope.METADATA_CORE,METADATA_APP,METADATA_CUSTOM,METADATA_ALLPptxTextScope.COMMENT_AUTHORS,METADATA_CORE,METADATA_APP,METADATA_CUSTOM,METADATA_ALLXlsxTextScope.COMMENTS,COMMENT_AUTHORS,METADATA_CORE,METADATA_APP,METADATA_CUSTOM,METADATA_ALL
ALL_TEXT now means all free-text fields, i.e. document content plus metadata/comment-author text where applicable.
Formatting-preserving replacement is available for OOXML content text:
patch = officemd.DocxPatch(
scoped_replacements=[
officemd.ScopedDocxReplace(
officemd.DocxTextScope.BODY,
officemd.TextReplace("Confidential", "", preserve_formatting=True),
)
]
)
Semantics:
- a match may span multiple runs
- the first matched run's formatting wins
- later consumed runs are left empty in v1
- metadata/comment-author fields still use simple text replacement
Supported Formats
| Format | Extension | Markdown | JSON IR | Docling |
|---|---|---|---|---|
| Word | .docx | yes | yes | yes |
| Excel | .xlsx | yes | yes | yes |
| CSV | .csv | yes | yes | - |
| PowerPoint | .pptx | yes | yes | yes |
| yes | yes | - |
License
MIT
Metadata
Release files for officemd 0.1.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| officemd-0.1.8.tar.gz | 1.6 MB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| officemd-0.1.8-cp312-abi3-win_amd64.whl | CPython 3.12 | abi3 | Windows x86-64 | Details |
| officemd-0.1.8-cp312-abi3-manylinux_2_34_x86_64.whl | CPython 3.12 | abi3 | Linux glibc 2.34+ x86-64 | Details |
| officemd-0.1.8-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.12 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| officemd-0.1.8-cp312-abi3-macosx_11_0_arm64.whl | CPython 3.12 | abi3 | macOS 11.0+ ARM64 | Details |
| officemd-0.1.8-cp312-abi3-macosx_10_12_x86_64.whl | CPython 3.12 | abi3 | macOS 10.12+ x86-64 | Details |
Total release size: 15.0 MB
Release files / officemd-0.1.8.tar.gz
| Download URL | officemd-0.1.8.tar.gz |
|---|---|
| Size | 1.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c191c87872e555aac493777c2631579840cad09a12e0d065e704426c0eb75374
|
|
BLAKE2b-256 checksum How to use checksums |
dd3d6e03f14eed607aecd1535b6a3c6fa6ff138e0acbbca01cb8499cf137c9dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 3, 2026.
Transparency logRelease files / officemd-0.1.8-cp312-abi3-win_amd64.whl
| Download URL | officemd-0.1.8-cp312-abi3-win_amd64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.12 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
09e42137b5574d4f8058cb4733cabe57ab9e6892b5bd99a5977f983aabca94a6
|
|
BLAKE2b-256 checksum How to use checksums |
12e4ea4b369cc4157073441cc0f16661a458e8868d957e7a332e5ac40463aaa1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 3, 2026.
Transparency logRelease files / officemd-0.1.8-cp312-abi3-manylinux_2_34_x86_64.whl
| Download URL | officemd-0.1.8-cp312-abi3-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.12 Linux glibc 2.34+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
42c9e18e88154ae51116dccb9b0cdd464c3f586f8edd21591c09442ecf4b7d55
|
|
BLAKE2b-256 checksum How to use checksums |
63cf8563c68f6db09eb072bd509c6f906915757416a134bcab3a7205388a1390
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 3, 2026.
Transparency logRelease files / officemd-0.1.8-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | officemd-0.1.8-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 2.6 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
14a310db0fa131f4682bc39a46affcd599ce061d882171bca73fcef3fa0912f2
|
|
BLAKE2b-256 checksum How to use checksums |
e03d50e01db1546c1248eadac1704095222f9df52dd92879ad84330e80d56a81
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 3, 2026.
Transparency logRelease files / officemd-0.1.8-cp312-abi3-macosx_11_0_arm64.whl
| Download URL | officemd-0.1.8-cp312-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 2.6 MB |
| Tags | CPython 3.12 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
8522e8586c4635efb33dbe99b0e7ef298c33f5e05300af002237682683ccdec5
|
|
BLAKE2b-256 checksum How to use checksums |
59220d5afb34272d57f227b12eac3987371aab76cd31d4aa3133613626686176
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 3, 2026.
Transparency logRelease files / officemd-0.1.8-cp312-abi3-macosx_10_12_x86_64.whl
| Download URL | officemd-0.1.8-cp312-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.12 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
ebc442f680a6d0b7fe6324556c01d1d9f58fae01e9e979d6b4c42a39a844a046
|
|
BLAKE2b-256 checksum How to use checksums |
52c21c201dea485c47a2e1a62cc198d947685c1cd4ae07d3d23745652f386993
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 3, 2026.
Transparency log