athena-python-docx
Drop-in replacement for python-docx that connects to Athena's Keryx-backed Word document stack.
Quick start
from docx import Document
from docx.shared import Inches, Pt, RGBColor
# Open an existing Word document asset by its Athena asset_id
with Document("asset_abc123") as doc:
doc.add_heading("Market Analysis", level=1)
p = doc.add_paragraph()
r = p.add_run("Revenue grew ")
highlight = p.add_run("12.3% year-over-year")
highlight.bold = True
highlight.font.color.rgb = RGBColor(0x00, 0x80, 0x00)
p.add_run(".")
t = doc.add_table(rows=2, cols=2, style="TableGrid")
t.cell(0, 0).text = "Segment"
t.cell(0, 1).text = "Revenue"
t.cell(1, 0).text = "Enterprise"
t.cell(1, 1).text = "$4.3M"
doc.save()
API parity rule
This SDK mirrors python-docx's public API exactly. See CLAUDE.md for the full contract.
Development
uv venv
uv pip install -e ".[dev]"
uv run pytest tests/ -x
DocX Execution Lab
For fast local repros against real Athena document assets, use the
headless runner in scripts/docx_exec_lab.py. It executes an arbitrary
Python snippet with this checkout of athena-python-docx, captures
stdout/stderr/errors/timings, and can export the resulting .docx for
text assertions. scripts/docx_exec_lab_server.py adds a local UI with
an Olympus Word document embed preview pane. See DOCX_EXEC_LAB.md.
Environment variables
Required when connecting to DOCX Studio (set by the Athena backend in the execute_word_document_code executor sandbox):
ATHENA_DOCX_BASE_URL— DOCX Studio API base URLATHENA_DOCX_API_KEY— Athena API key or service-issued DOCX Studio token
License
MIT
Metadata
Release files for athena-python-docx 0.24.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| athena_python_docx-0.24.0.tar.gz | 823.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| athena_python_docx-0.24.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.1 MB
Release files / athena_python_docx-0.24.0.tar.gz
| Download URL | athena_python_docx-0.24.0.tar.gz |
|---|---|
| Size | 823.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
570c9af0b1a9bc6ae843014614d2f05dc390af0478f7d92e3427d9311e7ed2a9
|
|
BLAKE2b-256 checksum How to use checksums |
d88d52bb8b4114c1df94ee75238ad62a224d76ca8e04a2b9e54c82ec300311c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / athena_python_docx-0.24.0-py3-none-any.whl
| Download URL | athena_python_docx-0.24.0-py3-none-any.whl |
|---|---|
| Size | 298.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1dea8bfdf2282d060a8c98b0c99ad193e8429fc5d7eb7d39b3df9efc78119049
|
|
BLAKE2b-256 checksum How to use checksums |
2bf0cd2bb4c5aa7b929aa511c11162b5a7bcbd5e5e89dc17f80424b9ee3c55dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|