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

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.2
File Size Uploaded
docxdriver-0.3.2.tar.gz 327.4 kB Details

Built distributions (wheels)

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

Total release size: 7.4 MB

Release files / docxdriver-0.3.2.tar.gz

Download URL docxdriver-0.3.2.tar.gz
Size 327.4 kB
Tags Source
SHA-256 checksum
How to use checksums
fc48c9a0cf2c8de32929f6c44b6ee89b18aa35ddbe7882e01ec79a847a716eef
BLAKE2b-256 checksum
How to use checksums
61e04271a2d71aa2bbe248cb5647a91d5d75dc26c26702abec15447c010cbd8b
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 16, 2026.

Transparency log

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

Download URL docxdriver-0.3.2-cp310-abi3-win_amd64.whl
Size 1.4 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
758c50a004b097518d1f2d643688962b6ea20bf04f78e8f9d0c3638b8306fa91
BLAKE2b-256 checksum
How to use checksums
939efa9feafcc10dbaf48fb07e4d282c100d38390f17739df5b4d2548516ac64
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 16, 2026.

Transparency log

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

Download URL docxdriver-0.3.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.5 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
7c1ff3f7299164bacd9d4eec7abb809230f89f5284c07339f687caece082d181
BLAKE2b-256 checksum
How to use checksums
acf095dd2bc9a0032f9f9a1a1b5561fac772020fa62ee54894f0e21f7a292df9
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 16, 2026.

Transparency log

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

Download URL docxdriver-0.3.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.5 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
76400a356fc67acac51555d184d4e4f99f666a3f8e2cc9e986d95963d6ac4b16
BLAKE2b-256 checksum
How to use checksums
e3f869d1c1bdab404dc95cf3f099a80ab769732eabf6ad9ce83d649a59ef7244
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 16, 2026.

Transparency log

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

Download URL docxdriver-0.3.2-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 2.7 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
d7ff008398257765451dce04a9f931afd03a2806136a9095c9bc4eec5dc93687
BLAKE2b-256 checksum
How to use checksums
273b604810e878c6727bba36e5c8d3ff01a4d00ef56164e0348c26fb366dadd0
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 16, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.3

5 release files

This release

0.3.2 This release

5 release files

0.3.1

5 release files

0.3.0

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