Skip to main content

rocx

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

Install and write your first DOCX · Feature guides · Compatibility

API: Rust · Python · JavaScript (Node/browser tarball, not on npm).

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())

JavaScript (Node ESM):

import { writeFile } from "node:fs/promises";
import { declarative as d, generateDocx } from "rocx-docx";

const document = d.Document([d.Section([
  d.Paragraph([d.TextRun("Hello, world!", { format: { bold: true } })]),
])]);
await writeFile("report.docx", await generateDocx(document));

Project information

Metadata

Release files for rocx 0.4.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.4.0
File Size Uploaded Provenance Actions
rocx-0.4.0.tar.gz 1.2 MB With provenance Details for rocx-0.4.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for rocx 0.4.0
File Interpreter ABI Platform Actions
rocx-0.4.0-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details for rocx-0.4.0-cp312-abi3-win_amd64.whl
rocx-0.4.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.4.0-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
rocx-0.4.0-cp312-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 10.12+ universal2 (ARM64, x86-64), macOS 11.0+ ARM64, macOS 10.12+ x86-64 Details for rocx-0.4.0-cp312-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl

Total release size: 10.5 MB

Release files / rocx-0.4.0.tar.gz

Download URL rocx-0.4.0.tar.gz
Size 1.2 MB
Tags Source
SHA-256 checksum
How to use checksums
0889ca3957c0001334a2944871f2666aa2a4a2fa4b0449fe34758706df5e8ddc
BLAKE2b-256 checksum
How to use checksums
49bbb6899549f4599678b0b5c960a3bc6de76313f4efd58ec8cd2b62de4670c4
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 25, 2026.

Transparency log

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

Download URL rocx-0.4.0-cp312-abi3-win_amd64.whl
Size 2.3 MB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
d05e2b453d41426bdaad7d2cc7663af85b7fc9fb510f31a55b971f1d36ffc5f7
BLAKE2b-256 checksum
How to use checksums
15b4f6a8ebf5a3f6306ee282707006cb014dda8ce68191b3dab43ac4248338b1
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 25, 2026.

Transparency log

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

Download URL rocx-0.4.0-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 2.5 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
ceff4e16f0a33ecb366b768c82385501702b5df5322da4ace628685873214c6f
BLAKE2b-256 checksum
How to use checksums
57a37abf441ec9a1966c6dca81edebbc4bbe82b8b18c6009ba2cb0d3fbe4e4b2
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 25, 2026.

Transparency log

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

Download URL rocx-0.4.0-cp312-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl
Size 4.6 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
13f20c8c0ed666f7d2226531ed6801c5d0c26ce8cca81b01c613cbc335b97d09
BLAKE2b-256 checksum
How to use checksums
57dce1713a972d43fcf3d6ae9238cfe98b2a36e2e979f3f355ee6dbfb58f011f
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 25, 2026.

Transparency log

Security for rocx 0.4.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.4.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 25, 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