Skip to main content

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_ALL
  • PptxTextScope.COMMENT_AUTHORS, METADATA_CORE, METADATA_APP, METADATA_CUSTOM, METADATA_ALL
  • XlsxTextScope.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
PDF .pdf yes yes -

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

officemd-0.1.8.tar.gz (1.6 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

officemd-0.1.8-cp312-abi3-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.12+Windows x86-64

officemd-0.1.8-cp312-abi3-manylinux_2_34_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.34+ x86-64

officemd-0.1.8-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.6 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.17+ ARM64

officemd-0.1.8-cp312-abi3-macosx_11_0_arm64.whl (2.6 MB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

officemd-0.1.8-cp312-abi3-macosx_10_12_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.12+macOS 10.12+ x86-64

File details

Details for the file officemd-0.1.8.tar.gz.

File metadata

  • Download URL: officemd-0.1.8.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for officemd-0.1.8.tar.gz
Algorithm Hash digest
SHA256 c191c87872e555aac493777c2631579840cad09a12e0d065e704426c0eb75374
MD5 f3ac4154cf34ff252159b546d31ba25c
BLAKE2b-256 dd3d6e03f14eed607aecd1535b6a3c6fa6ff138e0acbbca01cb8499cf137c9dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for officemd-0.1.8.tar.gz:

Publisher: release.yml on ThomAub/officemd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file officemd-0.1.8-cp312-abi3-win_amd64.whl.

File metadata

  • Download URL: officemd-0.1.8-cp312-abi3-win_amd64.whl
  • Upload date:
  • Size: 2.7 MB
  • Tags: CPython 3.12+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for officemd-0.1.8-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 09e42137b5574d4f8058cb4733cabe57ab9e6892b5bd99a5977f983aabca94a6
MD5 ebda9f6d885f3fac6db6a79505259ac5
BLAKE2b-256 12e4ea4b369cc4157073441cc0f16661a458e8868d957e7a332e5ac40463aaa1

See more details on using hashes here.

Provenance

The following attestation bundles were made for officemd-0.1.8-cp312-abi3-win_amd64.whl:

Publisher: release.yml on ThomAub/officemd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file officemd-0.1.8-cp312-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for officemd-0.1.8-cp312-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 42c9e18e88154ae51116dccb9b0cdd464c3f586f8edd21591c09442ecf4b7d55
MD5 53d75809becd6918d8cb1fb0c1d1b97b
BLAKE2b-256 63cf8563c68f6db09eb072bd509c6f906915757416a134bcab3a7205388a1390

See more details on using hashes here.

Provenance

The following attestation bundles were made for officemd-0.1.8-cp312-abi3-manylinux_2_34_x86_64.whl:

Publisher: release.yml on ThomAub/officemd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file officemd-0.1.8-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for officemd-0.1.8-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 14a310db0fa131f4682bc39a46affcd599ce061d882171bca73fcef3fa0912f2
MD5 3ab8cbc1b144ad604cdda264f918ee65
BLAKE2b-256 e03d50e01db1546c1248eadac1704095222f9df52dd92879ad84330e80d56a81

See more details on using hashes here.

Provenance

The following attestation bundles were made for officemd-0.1.8-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on ThomAub/officemd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file officemd-0.1.8-cp312-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for officemd-0.1.8-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8522e8586c4635efb33dbe99b0e7ef298c33f5e05300af002237682683ccdec5
MD5 9294713ba529da059078a64eea2e108a
BLAKE2b-256 59220d5afb34272d57f227b12eac3987371aab76cd31d4aa3133613626686176

See more details on using hashes here.

Provenance

The following attestation bundles were made for officemd-0.1.8-cp312-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on ThomAub/officemd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file officemd-0.1.8-cp312-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for officemd-0.1.8-cp312-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ebc442f680a6d0b7fe6324556c01d1d9f58fae01e9e979d6b4c42a39a844a046
MD5 5f74e07c148ccaa1713c397ee4187bb3
BLAKE2b-256 52c21c201dea485c47a2e1a62cc198d947685c1cd4ae07d3d23745652f386993

See more details on using hashes here.

Provenance

The following attestation bundles were made for officemd-0.1.8-cp312-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on ThomAub/officemd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page