docxdriver
Python SDK for the Rust DOCX engine. It supports Python 3.10 and later and has no Python runtime dependencies.
Install from PyPI:
python -m pip install docxdriver
Document works on .docx bytes; typed plan builders live in
docxdriver.plan:
from pathlib import Path
from docxdriver import Document, create
from docxdriver.plan import Plan, ReplaceText
doc = Document(Path("contract.docx").read_bytes())
doc.markup() # body with the ids plans address
doc.comments(); doc.revisions(); doc.styles(); doc.assets()
doc.find("thirty")
review = doc.review(Plan(author="Reviewer", ops=[
ReplaceText(at="0F537164", select="thirty", with_="sixty"),
]))
review.report # preview: each op's outcome
Path("contract.docx").write_bytes(doc.commit(review.key).data)
new = create(paragraphs=["Hello"]) # or create(html="<p>Hello</p>")
Commit keys are single-use. Natively review.key carries the key; in a
sandbox it is None and the host shows the key only to the model, so a
commit proves the review was read. Sandbox hosts written in Python build on
the stateless review_plan(data, plan_json) and
commit_plan(data, plan_json, key), keeping each plan under a key they issue.
Engine diagnostics raise ValueError. The lower-level execute_request,
canonical_plan_json, run_command, run_plan and run_request remain.
plan.py and document.py stay within Monty's Python subset. Rust hosts get
the same text as docxdriver_monty_repl::PLAN and DOCUMENT, so sandbox code
and native code are interchangeable. The op dataclasses are generated from the
core schema; regenerate from the repository root with
python scripts/generate-python-plan.py.
Version 0.4.0 removed the docxdriver.repl sandbox host from this package. Its
source remains in experimental/python-repl-host for hosts to vendor.
Build and install a wheel from the repository root:
python -m pip install "maturin>=1.9,<2"
maturin build --profile python --locked --manifest-path crates/docxdriver-python/Cargo.toml --out /tmp/docxdriver-wheels
python -m pip install /tmp/docxdriver-wheels/*.whl
Publish to PyPI
The Publish Python SDK GitHub Actions workflow builds a source distribution
and wheels for Linux x86_64 and aarch64, macOS universal2, and Windows x86_64
when a v* tag is pushed. The tag must match the version in the root
Cargo.toml workspace package.
Before the first release, configure a PyPI trusted publisher for the
docxdriver project with these values:
- Owner:
jhnoel - Repository:
docxdriver - Workflow filename:
pypi.yml - GitHub environment:
pypi
Create the pypi GitHub environment under the repository settings if you want
to add release approvals. Then update the workspace version, commit the change,
and push the matching tag (for example, v0.2.7). GitHub Actions publishes the
built distributions using PyPI's trusted publishing; no long-lived PyPI token is
needed.
The python Cargo profile keeps release optimizations and enables panic unwinding
so PyO3 can turn Rust panics into Python exceptions. ABI3 wheels support Python
3.10 and later on the built operating system and architecture. To run the Python
SDK and host tests after installing the wheel:
python -m unittest discover -s crates/docxdriver-python/tests
Metadata
Release files for docxdriver 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| docxdriver-0.4.1.tar.gz | 269.0 kB | With provenance | Details for docxdriver-0.4.1.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| docxdriver-0.4.1-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details for docxdriver-0.4.1-cp310-abi3-win_amd64.whl |
| docxdriver-0.4.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ x86-64 | Details for docxdriver-0.4.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
| docxdriver-0.4.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ ARM64 | Details for docxdriver-0.4.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
| docxdriver-0.4.1-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl | CPython 3.10 | abi3 | macOS 10.12+ universal2 (ARM64, x86-64), macOS 11.0+ ARM64, macOS 10.12+ x86-64 | Details for docxdriver-0.4.1-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl |
Total release size: 8.3 MB
Release files / docxdriver-0.4.1.tar.gz
| Download URL | docxdriver-0.4.1.tar.gz |
|---|---|
| Size | 269.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
98ffec1cc0d78fa6d9f65e249e4a91f75cc213f443a0366e80d3b990c16fe80e
|
|
BLAKE2b-256 checksum How to use checksums |
5ed9508df40bf37bcbaaf209357f8d9240b2acf14ad8f0588199c1543408ae46
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 19, 2026.
Transparency logRelease files / docxdriver-0.4.1-cp310-abi3-win_amd64.whl
| Download URL | docxdriver-0.4.1-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
bdded7a8c5ece9a23872cbedad5b80a3c101c50d4f2c3499caf5f67dde899572
|
|
BLAKE2b-256 checksum How to use checksums |
88ed5a9864a3b00c96b779f361a8181854d3ee20f42429127aff5a5cec98042e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 19, 2026.
Transparency logRelease files / docxdriver-0.4.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | docxdriver-0.4.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.7 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
fe0342d6e53b4f594bff4f6c4be83b850380d982de1c15446ac0faf6c77b8b77
|
|
BLAKE2b-256 checksum How to use checksums |
685765ece5de803ce4a5ca99b45419565bd72f2a5d82bd88bf1ddb1baf682ecb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 19, 2026.
Transparency logRelease files / docxdriver-0.4.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | docxdriver-0.4.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 1.7 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
c869ec135793499af0fc6428d5c3830ccb4692687137d39cc87e0be8d9b6da93
|
|
BLAKE2b-256 checksum How to use checksums |
eb51f4d4983fb63c01f4825e54f9d6b9445f1de15f8d93aa17609d729e7cb97b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 19, 2026.
Transparency logRelease files / docxdriver-0.4.1-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
| Download URL | docxdriver-0.4.1-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl |
|---|---|
| Size | 3.1 MB |
| Tags | CPython 3.10 abi3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
eabf3da1f5e3d587c28e07e0ea3558c860c4c5a4fd0d019c26f5940d5e0ff654
|
|
BLAKE2b-256 checksum How to use checksums |
d1c8ea1e2da9da1e2ee9ed8ab0347e00e1bba55935681a4c94733ae331da77ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 19, 2026.
Transparency logSecurity for docxdriver 0.4.1
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.
Full provenance
All 5 files in this release have been uploaded with provenance metadata.
Attestation for docxdriver-0.4.1.tar.gz
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 Oct 19, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.