Skip to main content

rocx

Create Word .docx files in Rust or Python. Describe the document in code; rocx writes the DOCX package. It does not render pages, paginate documents, or calculate fields such as page numbers.

Start here:

Example

Rust:

use rocx::{Document, Error, Paragraph, RunFormat, Section, TextRun};

async fn write_report() -> Result<(), Error> {
    let title = TextRun::new("Hello, world!")
        .with_format(RunFormat::default().with_bold(true));
    let document = Document::new(vec![
        Section::new(vec![Paragraph::from_children(vec![title.into()]).into()]).into(),
    ]);
    document.resolve().await?.save("report.docx")
}

Python:

import asyncio
from rocx.declarative import Document, Paragraph, Section, TextRun

async def main():
    document = Document([Section(children=[Paragraph(children=[
        TextRun(text="Hello, world!", bold=True),
    ])])])
    await document.save("report.docx")

asyncio.run(main())

Both APIs support text, formatting, tables, images, links, templates, and more. Their constructors and async behavior differ; the guides describe those differences and the limits of each feature.

Project information

Contributing

Install prek and enable its Git hook once per clone:

uv tool install prek
prek install

With Cargo and rustfmt installed, prek runs cargo fmt --check before each commit, temporarily setting aside unstaged edits to tracked files. If it fails, run cargo fmt and stage the intended formatting changes before retrying. GitHub Actions checks formatting even if prek is not installed.

Metadata

Release files for rocx 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 rocx 0.3.0
File Size Uploaded Provenance Actions
rocx-0.3.0.tar.gz 715.7 kB With provenance Details for rocx-0.3.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for rocx 0.3.0
File Interpreter ABI Platform Actions
rocx-0.3.0-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details for rocx-0.3.0-cp312-abi3-win_amd64.whl
rocx-0.3.0-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.12 abi3 Linux glibc 2.17+ x86-64 Details for rocx-0.3.0-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
rocx-0.3.0-cp312-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64, macOS 10.12+ x86-64, macOS 10.12+ universal2 (ARM64, x86-64) Details for rocx-0.3.0-cp312-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl

Total release size: 5.5 MB

Release files / rocx-0.3.0.tar.gz

Download URL rocx-0.3.0.tar.gz
Size 715.7 kB
Tags Source
SHA-256 checksum
How to use checksums
059801a4cde07c3fc8b17eefbcdd19ab1e5c7d72a7e6f8fb32dfc9ab52f6370d
BLAKE2b-256 checksum
How to use checksums
d677aaaca77b8818aa69e959b73e7d74ccefe881cf3d6861b7fde935a1871dab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 23, 2026.

Transparency log

Release files / rocx-0.3.0-cp312-abi3-win_amd64.whl

Download URL rocx-0.3.0-cp312-abi3-win_amd64.whl
Size 1.1 MB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
42da49fe07e21a42e0fdc1bd520e56a28906ebb2e1c0831b9f910e7fb15df580
BLAKE2b-256 checksum
How to use checksums
3bfaad2e8f9d1aa70c1c2a7254ef66af225dc2580cf74b7c0c954bd215050fe7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 23, 2026.

Transparency log

Release files / rocx-0.3.0-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL rocx-0.3.0-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 1.3 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
bf686df224903147f44e1be5aae39b798d30dba8932df25f696bf39275eb803d
BLAKE2b-256 checksum
How to use checksums
b2164d5a321e76558ba389500912bdafa8ca80fee8a281c909db739ce2437aff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 23, 2026.

Transparency log

Release files / rocx-0.3.0-cp312-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl

Download URL rocx-0.3.0-cp312-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl
Size 2.4 MB
Tags CPython 3.12 abi3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
045f5d8c502d252a73736f61fdd3b577c48b6db6d443de838881c134bcc74f11
BLAKE2b-256 checksum
How to use checksums
9dfd90c24bd2ca90b5498827a3d1f067d4e84a8118e4d24affbdf88db373bd43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 23, 2026.

Transparency log

Security for rocx 0.3.0

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 4 files in this release have been uploaded with provenance metadata.

Select from 4 files

Attestation for rocx-0.3.0.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 Nov 23, 2026.

Transparency log

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

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