Skip to main content

edit2docs

AI-agent-native document engine — DOCX · XLSX · PPTX. English-first, with first-class Korean support.

한국어 README · Sister project of edit2ppt (the PPTX pipeline is inherited from it) · Built on ppt-master (MIT)


edit2docs generates complete Office documents from a one-line intent and chat-edits existing files — Word reports, Excel workbooks and PowerPoint decks — always producing natively editable OOXML. One engine, four surfaces:

pip install edit2docs              # library + agent tools + local MCP
pip install "edit2docs[server]"    # + the hosted multi-tenant service

The five verbs

Every surface exposes the same five format-dispatched verbs — the file extension picks the engine:

verb what it does LLM?
generate_doc intent (+ optional sources / PPTX template) → complete document
edit_doc one natural-language edit turn; untouched content stays byte-identical
preview_doc .pptx → per-slide SVG · .docx/.xlsx → markdown
analyze_doc structure outline with the exact addresses set_doc_text needs
set_doc_text deterministic targeted edits (paragraphs / cells / slide text)

1 · Python library

from edit2docs import generate_doc, edit_doc, preview_doc, analyze_doc, set_doc_text

generate_doc("Q3 performance report", output="report.docx")
generate_doc("Quarterly sales summary", output="sales.xlsx", sources=["raw.pdf"])
generate_doc("Executive briefing on Q3 sales", output="deck.pptx",
             template="brand.pptx", deck_mode="template_restyle")
generate_doc("3분기 실적 보고서", output="report.docx", lang="ko-KR")  # Korean works the same

r = edit_doc("report.docx", "Add a 'deployment complete' item to the progress section")
print(r.reply, r.operations)

info = analyze_doc("sales.xlsx")               # sheets + sample rows
set_doc_text("sales.xlsx", [{"sheet": "Sales", "cell": "B3", "value": 142}])

BYOK: api_key=... or ANTHROPIC_API_KEY. The deterministic verbs need no key. Async variants: async_generate_doc, async_edit_doc.

2 · Agent tools (function calling)

from edit2docs.agent_tools import ANTHROPIC_TOOLS, run_tool

msg = client.messages.create(model="claude-opus-4-7", tools=ANTHROPIC_TOOLS, ...)
for block in msg.content:
    if block.type == "tool_use":
        result = run_tool(block.name, block.input)

3 · Local MCP server (zero infra)

// Claude Desktop / Claude Code / Cursor
{ "mcpServers": { "edit2docs": {
    "command": "edit2docs-mcp",
    "env": { "ANTHROPIC_API_KEY": "sk-ant-..." }
} } }

4 · Hosted service

pip install "edit2docs[server]" then edit2docs serve — the FastAPI service (REST + SSE jobs + hosted MCP) inherited from edit2ppt: multi-tenant assets, job queue, S3-compatible storage, PPTX studio endpoints.

How each format works

  • DOCX — the writer LLM emits a constrained markdown document; a deterministic renderer (python-docx) turns it into styled Word. Edits are paragraph-addressed operations (replace / insert_after / delete, table cells by row/col) so untouched paragraphs keep their formatting. The hosted preview is a native, addressable HTML rendering: every paragraph carries data-e2d-para and every table cell data-e2d-table/data-e2d-cell — the same addresses the outline and the live-edit op stream use — plus real merged cells, alignment, colors, images, footnotes and page breaks (mirroring the PPTX canvas's data-e2p-* tags).
  • XLSX — the designer LLM emits a YAML sheet spec (sheets / headers / rows / number formats, formulas allowed); openpyxl renders styled sheets. Edits are set_cell / append_rows / add_sheet with staleness guards. The hosted preview renders a spreadsheet-style grid (column letters, row numbers, merged ranges, cached formula results) with every cell stamped data-e2d-cell="B3" — exactly the address set_cell takes.
  • PPTX — the full multi-stage deck pipeline inherited from edit2ppt: strategist → per-page SVG → native DrawingML, user-PPTX templates (restyle/extend), chat-edit with slide recompose, per-paragraph text edits incl. table cells. Exported text is paragraph-merged (edits as real paragraphs, not per-line boxes), and SVG groups marked data-pptx-native="chart|table" export as native, editable PowerPoint charts (chart XML + embedded workbook) and tables — not drawn shapes (ExportRequest(native_objects=True)).

Every LLM planner follows the same contract: fenced reply + edit_plan blocks, one retry with a format reminder, and an honest reply (instead of a silent no-op) when planning fails.

Languages. English is the default (lang="en-US"); Korean is a first-class citizen, not an afterthought — Hangul-aware text widths, per-run OOXML lang attributes detected from the actual script, Korean font stacks (Pretendard/Malgun), a complete Korean message catalog, and localized chat replies. Pass lang="ko-KR" per call or set EDIT2DOCS_DEFAULT_LANG=ko-KR to make a deployment Korean-by-default. zh-CN/zh-TW/ja-JP get the same script detection and font-stack treatment.

License

MIT. PPTX core forked from ppt-master (MIT) via edit2ppt.

Download files

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

Source Distribution

edit2docs-0.7.0.tar.gz (5.9 MB view details)

Uploaded Source

Built Distribution

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

edit2docs-0.7.0-py3-none-any.whl (10.7 MB view details)

Uploaded Python 3

File details

Details for the file edit2docs-0.7.0.tar.gz.

File metadata

  • Download URL: edit2docs-0.7.0.tar.gz
  • Upload date:
  • Size: 5.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for edit2docs-0.7.0.tar.gz
Algorithm Hash digest
SHA256 78ab3e5d06751abb5ef3f6fd9f32b9a6c000b05a8d49abbe753d398e30417960
MD5 323229c15f4694b7357594b53c24c01b
BLAKE2b-256 b8b284cb3a424b23eb54afea04955835450d8519b449585eb3f20b70a34917e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for edit2docs-0.7.0.tar.gz:

Publisher: publish.yml on CocoRoF/edit2docs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file edit2docs-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: edit2docs-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 10.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for edit2docs-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 16109aa3a875bf6f78d856eac16199c5b6525f91fbce562c4d37152c3b36afb9
MD5 25160e6b1ecf993e3b1e13515ac45cd8
BLAKE2b-256 4bfa67ca685d46d501699db32dfac5a9f2d9474dccf5206c76224ab47f61883c

See more details on using hashes here.

Provenance

The following attestation bundles were made for edit2docs-0.7.0-py3-none-any.whl:

Publisher: publish.yml on CocoRoF/edit2docs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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