Skip to main content

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

The core API exposes execute_request, canonical_plan_json, and the convenience functions run_command, run_plan, and run_request. Results preserve document contents as Python bytes.

The optional sandbox REPL harness is available as a subpackage in the same distribution:

from docxdriver.repl import NativeBridge, PRELUDE, REFERENCE

NativeBridge provides async init, call, and reset requests for a host running a Python sandbox. The sandbox receives authoring classes and async wrappers from PRELUDE; REFERENCE provides their API documentation. The sandbox itself does not import the native extension. Native work runs through host callbacks outside the server event loop.

The host confines reads and writes to the provided workspace, verifies source hashes and candidate output before commit, and performs atomic file replacement with read-back verification. Commit keys are bounded and single-use. Cancellation is drained before another host call so a write callback cannot be abandoned.

Set DOCXDRIVER_QUOTE_AUDIT_COMMENTS=1 to enable structured Quote/Term/Inline plan values and protected quotation audit comments. The provenance policy defaults to permissive; controlled and authoritative fail closed.

The prelude and API reference are generated from shared Pi templates. After changing those templates, regenerate them from the repository root:

python scripts/generate-docxdriver-repl-prelude.py

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.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for docxdriver 0.3.0
File Size Uploaded
docxdriver-0.3.0.tar.gz 284.2 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for docxdriver 0.3.0
File
docxdriver-0.3.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
docxdriver-0.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details
docxdriver-0.3.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details
docxdriver-0.3.0-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 10.12+ x86-64, macOS 11.0+ ARM64 Details

Total release size: 6.5 MB

Release files / docxdriver-0.3.0.tar.gz

Download URL docxdriver-0.3.0.tar.gz
Size 284.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b074e03835cc3877bed2233a29444434cf2303677348fc240225d5e3f8da1578
BLAKE2b-256 checksum
How to use checksums
ce8e81c636c24b5e47fc241f1b414baaca22aa92e3058737bd3c51bf13c4b687
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 14, 2026.

Transparency log

Release files / docxdriver-0.3.0-cp310-abi3-win_amd64.whl

Download URL docxdriver-0.3.0-cp310-abi3-win_amd64.whl
Size 1.2 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
23bcbe3a3b5cd5e8760a69d39925bd653fbf7dabe0c04ee5bf3a1581159d9e14
BLAKE2b-256 checksum
How to use checksums
a0e47fa94dfb6efa4c6a605c567577da9451db5c6162e26f8577e6b25b27710e
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 14, 2026.

Transparency log

Release files / docxdriver-0.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL docxdriver-0.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.3 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
5d7cfa1e62954f5b75a610d5a1d05a15c23bd76c869271ddf131ac7f72a40259
BLAKE2b-256 checksum
How to use checksums
27e86906dbf7820220a46daccdca0d573bb2a2e59b5b0ad52119e5196acbe712
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 14, 2026.

Transparency log

Release files / docxdriver-0.3.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL docxdriver-0.3.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.3 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
07c2421eb7a7579a4614cd9b72032baf48e26400c2a587c66bd473245c328013
BLAKE2b-256 checksum
How to use checksums
ca2597208d221408b9d0a0d74592bd5a62972a0eede76e08d9a63c0e8cd95d17
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 14, 2026.

Transparency log

Release files / docxdriver-0.3.0-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL docxdriver-0.3.0-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 2.4 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
de9c37ee48196a10db3098920cbbf55b2cdbfc58b0fb13bc9afb3bf66a50fe34
BLAKE2b-256 checksum
How to use checksums
df6b0bcbd2b3a0b40feed4dda79332e7ce41306cacfadd321edce2ff7703a182
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 14, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.3

5 release files

0.3.2

5 release files

0.3.1

5 release files

This release

0.3.0 This release

5 release files

0.2.7

5 release 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