Skip to main content

rdocx-py

Native rdocx for Python

rdocx gives Python applications a native DOCX workflow for creating, opening, editing, comparing, laying out, and rendering Word documents. It works directly with OOXML packages and does not require Microsoft Word, LibreOffice, a conversion service, or a Java or .NET runtime.

The package uses the Rust rdocx document engine. Unsupported safe producer XML remains available to the package rather than being discarded during an ordinary open and save cycle.

Installation

Install the current release from PyPI:

python -m pip install rdocx

rdocx requires CPython 3.9 or newer. Its platform wheels use the Python 3.9 stable ABI, so one wheel supports multiple compatible Python versions. Source installation requires a Rust toolchain and maturin.

Quick start

from rdocx import Document

doc = Document()
doc.add_paragraph("Hello from Python")
doc.save("hello.docx")

pdf = doc.to_pdf()
with open("report.pdf", "wb") as output:
    output.write(pdf)

Capabilities

  • File and byte-based DOCX input and output.
  • Paragraphs, runs, fonts, tables, rows, cells, sections, and styles.
  • Rich headers, footers, related stories, and resolved hyperlinks.
  • Tracked comparison, main-body comment threads, revision resolution, and TOC rebuilding.
  • Deterministic layout fragments, page geometry, and PDF, PNG, JPEG, and TIFF output through the native document engine.
  • Python collections with negative indexes, slices, iteration, and explicit stale-handle errors after structural changes.

Use it when

Use rdocx when a Python service, desktop application, or automation task needs to work with Word documents locally. It is suited to template updates, document assembly, review workflows, comparison, and deterministic output.

Relationship

The Python API is intentionally focused. It is source compatible with the documented rdocx surface, but it is not a drop-in replacement for every python-docx method or private lxml object.

Example

Open and update an existing document:

from rdocx import Document

document = Document("template.docx")
document.add_paragraph("Approved")
document.save("approved.docx")

Type checking

The distribution includes hand-written extension stubs and a py.typed marker. Editors and type checkers can inspect concrete document, paragraph, run, table, section, story, comment, comparison, and layout types.

python -m pip install mypy
python -m mypy your_application.py

The release gate validates the installed package with strict mypy and stubtest in addition to its runtime suite.

License

Licensed under either the MIT License or the Apache License 2.0, at your option.

Download files

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

Source Distribution

rdocx-0.13.2.tar.gz (7.2 MB view details)

Uploaded Source

Built Distributions

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

rdocx-0.13.2-cp39-abi3-win_amd64.whl (12.6 MB view details)

Uploaded CPython 3.9+Windows x86-64

rdocx-0.13.2-cp39-abi3-musllinux_1_2_x86_64.whl (12.7 MB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ x86-64

rdocx-0.13.2-cp39-abi3-manylinux_2_28_x86_64.whl (12.5 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ x86-64

rdocx-0.13.2-cp39-abi3-manylinux_2_28_aarch64.whl (12.1 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ ARM64

rdocx-0.13.2-cp39-abi3-macosx_11_0_arm64.whl (12.0 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

rdocx-0.13.2-cp39-abi3-macosx_10_12_x86_64.whl (12.2 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file rdocx-0.13.2.tar.gz.

File metadata

  • Download URL: rdocx-0.13.2.tar.gz
  • Upload date:
  • Size: 7.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for rdocx-0.13.2.tar.gz
Algorithm Hash digest
SHA256 899d2fae1bb2acc8f5d94e2e2cd55604f9a171efdf47f44087f77439f7b1fe7f
MD5 96405b290565285fc773802f4d086898
BLAKE2b-256 1afcac855af803833db1a1eaf1d5f521bdeca5045e9442954e64e9dd9cd55d88

See more details on using hashes here.

Provenance

The following attestation bundles were made for rdocx-0.13.2.tar.gz:

Publisher: wheels.yml on tensorbee/rdocx

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

File details

Details for the file rdocx-0.13.2-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: rdocx-0.13.2-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 12.6 MB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for rdocx-0.13.2-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 d81ee97c1f30cac667dc03024b4163dc9308e7479dc9e9e6ca54e1660e8b695d
MD5 3324d4ee9a1aeda6cd598c03f3d1b187
BLAKE2b-256 787d7b9e9f2e68d1014a93746d8272351b25b1a38bf4a07e2342485072d68efc

See more details on using hashes here.

Provenance

The following attestation bundles were made for rdocx-0.13.2-cp39-abi3-win_amd64.whl:

Publisher: wheels.yml on tensorbee/rdocx

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

File details

Details for the file rdocx-0.13.2-cp39-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for rdocx-0.13.2-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 0aff68233c87d3cf873145082745c85b1b685ba6715b0a7252ed57eeeba1479a
MD5 7a9126283dad1585407ad13b29b0813d
BLAKE2b-256 1df8cb8dcd57c40379c65a76fd6076561d1dc8692bdc6cb5be93dbf707af4396

See more details on using hashes here.

Provenance

The following attestation bundles were made for rdocx-0.13.2-cp39-abi3-musllinux_1_2_x86_64.whl:

Publisher: wheels.yml on tensorbee/rdocx

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

File details

Details for the file rdocx-0.13.2-cp39-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rdocx-0.13.2-cp39-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0900aad2f1d5404d23059aa67df7021faa2158ed08ed5940467bfd7cdccd258d
MD5 ab95657180ba693a521e173c6c17d930
BLAKE2b-256 b3b24e247fbe578457d7f48da5a6411075ced7d518a145f456cdf7e10a1ce528

See more details on using hashes here.

Provenance

The following attestation bundles were made for rdocx-0.13.2-cp39-abi3-manylinux_2_28_x86_64.whl:

Publisher: wheels.yml on tensorbee/rdocx

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

File details

Details for the file rdocx-0.13.2-cp39-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for rdocx-0.13.2-cp39-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 3be78d4a33efa89a73ce1f8e59322ae15f700f056cd5b1887f3c04a2d38e9d52
MD5 b86ad68db5c8fd3bf8a529579f96a445
BLAKE2b-256 f946b86bcc9d8d6166ede3c632f54d5d98983b511093fecf3014b5a9b8ab1bd5

See more details on using hashes here.

Provenance

The following attestation bundles were made for rdocx-0.13.2-cp39-abi3-manylinux_2_28_aarch64.whl:

Publisher: wheels.yml on tensorbee/rdocx

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

File details

Details for the file rdocx-0.13.2-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rdocx-0.13.2-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c4b6bdfc32ca4c1f555f03ac0c09e93bd4514786a4449604b76fc35059dafb4f
MD5 10da6410891c9204506cff4406c32497
BLAKE2b-256 2f6ce22781a02575f8cf46229d4d84ef3f0b3b0b82ea5d5951edc7b605ceef8c

See more details on using hashes here.

Provenance

The following attestation bundles were made for rdocx-0.13.2-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: wheels.yml on tensorbee/rdocx

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

File details

Details for the file rdocx-0.13.2-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for rdocx-0.13.2-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 dfcc6a9862075440fecfa80207274172c24b9126fdbc3f2fe6fe7d1a20911d18
MD5 fc62215f76887c288bf24c20cb0b6d21
BLAKE2b-256 e544c685d0db808c5613db5521d40acecaefa0f7c25f4ae8706feee6d06175e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for rdocx-0.13.2-cp39-abi3-macosx_10_12_x86_64.whl:

Publisher: wheels.yml on tensorbee/rdocx

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

Release history Release notifications | RSS feed

This release

0.13.2 This release

7 files

0.13.1

7 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page