Skip to main content

Drop-in replacement for python-docx that connects to Athena's DOCX Studio collaborative document stack

Project description

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 Athena backend when executing in Daytona):

  • ATHENA_DOCX_BASE_URL — DOCX Studio API base URL
  • ATHENA_DOCX_API_KEY — Athena API key or service-issued DOCX Studio token

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

athena_python_docx-0.21.3.tar.gz (797.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

athena_python_docx-0.21.3-py3-none-any.whl (285.6 kB view details)

Uploaded Python 3

File details

Details for the file athena_python_docx-0.21.3.tar.gz.

File metadata

  • Download URL: athena_python_docx-0.21.3.tar.gz
  • Upload date:
  • Size: 797.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for athena_python_docx-0.21.3.tar.gz
Algorithm Hash digest
SHA256 7da170c6239b9da204085299436d659e9cf5646b6ae552e187bf9b56fce9f97d
MD5 6eba7e7da2a075a3858f81620d0093e9
BLAKE2b-256 f84f86bd8a83a19d7f70bc8e4e405d48d3ace69da4e8fcf92dd737e53f968081

See more details on using hashes here.

File details

Details for the file athena_python_docx-0.21.3-py3-none-any.whl.

File metadata

File hashes

Hashes for athena_python_docx-0.21.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ca0833092f6da7c2555549b12979128f83437edb45b53bb3751c186a82d04bd7
MD5 e15c2360bb8ab6df3b3aea46b1af92a9
BLAKE2b-256 a647f2c0a908ac3ca279f42f302997a4f49f7802be42ecac5d5f17b4d905a188

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page