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

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.3
File Size Uploaded
docxdriver-0.3.3.tar.gz 345.7 kB Details

Built distributions (wheels)

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

Total release size: 7.6 MB

Release files / docxdriver-0.3.3.tar.gz

Download URL docxdriver-0.3.3.tar.gz
Size 345.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f47f36d768f73a7aae27f5fb935ef94e36073c44360012328a543f8e554ff9b0
BLAKE2b-256 checksum
How to use checksums
a636b857417d76277fb3f4fae1b026fb4ad5fefbbd823a1c9b825f68836af44b
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.3-cp310-abi3-win_amd64.whl

Download URL docxdriver-0.3.3-cp310-abi3-win_amd64.whl
Size 1.4 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
98e471f2d38ad73c1bc81ce0a432f1f70542cea68630d98edb7296f74a814873
BLAKE2b-256 checksum
How to use checksums
51edcf787c0524462889ca4f45b215bb753957a0cedf3ebf8c7fb0f27f99b242
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.3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL docxdriver-0.3.3-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
bca89f77fe8f0187a23e6b75427128a817159a003691057c2ac14a334c6aafda
BLAKE2b-256 checksum
How to use checksums
3b3800c250228e712ea83bc42ced5fbb16e8078f5187164331e47be9759fc5d1
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.3-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL docxdriver-0.3.3-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
c0ba1415affc12ea14911068a9921703c96b8baaffad3e59c084be617d0f01b2
BLAKE2b-256 checksum
How to use checksums
a02989910fc884cff74c4d8d0c969fbe1c7ecbd9ad3045c64bd60103da557a2e
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.3-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL docxdriver-0.3.3-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 2.8 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
c965d4dd35de618a0072d666a693332fd96522ff3ec2f048ffcd086d9169f6ec
BLAKE2b-256 checksum
How to use checksums
e1cb4cf3dd022525a0ae7c70c5e037a2eb39d83b64d85beb5e767b4d21a41390
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

This release

0.3.3 This release

5 release files

0.3.2

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