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

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.1
File Size Uploaded
docxdriver-0.3.1.tar.gz 324.1 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for docxdriver 0.3.1
File
docxdriver-0.3.1-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
docxdriver-0.3.1-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.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details
docxdriver-0.3.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

Total release size: 7.4 MB

Release files / docxdriver-0.3.1.tar.gz

Download URL docxdriver-0.3.1.tar.gz
Size 324.1 kB
Tags Source
SHA-256 checksum
How to use checksums
3f6b0e775270949abcc9c695f75bbaf7469bcaac16e6e9b086fe87cf71a35321
BLAKE2b-256 checksum
How to use checksums
c75207cfc3c36a78049fbb8267b039755e26dc90832a21432e1675e23fb087c3
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 15, 2026.

Transparency log

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

Download URL docxdriver-0.3.1-cp310-abi3-win_amd64.whl
Size 1.4 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
73d2bdd60455c4d1bf3125632388a751f6d3207be4a713c5ac386499a1e7c638
BLAKE2b-256 checksum
How to use checksums
6f8c18c93d76b7d884918e5514fa8f92999dc9a31621989a6873bd744e533205
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 15, 2026.

Transparency log

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

Download URL docxdriver-0.3.1-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
e692bef37e82c5df9f908bfc45e8b32b84acabd29c905892f47f3c37151603f2
BLAKE2b-256 checksum
How to use checksums
3620b852738df194db0f2c5bbd7d101d7fcf37e75633a6d33914223a8ea4cd7b
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 15, 2026.

Transparency log

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

Download URL docxdriver-0.3.1-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
87d3149d7af3ea86c946f03df06559fa519744c75e65a9cc18d84c440dadb74c
BLAKE2b-256 checksum
How to use checksums
f7449c91edaa2318f3f48b408f990dbf762cb892eb214bf06e7fef0da6a4f89b
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 15, 2026.

Transparency log

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

Download URL docxdriver-0.3.1-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
2d7fd0ea1eb661d3e7eff290659e5852611df5b95ceae1053a331e9e507771fc
BLAKE2b-256 checksum
How to use checksums
e72495683b082492398b6711afeebcdbe7c6389c813a823153c36cd16c372fed
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 15, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.3

5 release files

0.3.2

5 release files

This release

0.3.1 This release

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