AI-agent-native document engine: generate and chat-edit DOCX, XLSX and PPTX as a Python library, agent tool set, MCP server or hosted service. Korean-first. Sister project of edit2ppt.
Project description
edit2docs
AI-agent-native document engine — DOCX · XLSX · PPTX. Korean-first.
한국어 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("3분기 실적 보고서", output="report.docx")
generate_doc("분기별 매출 정리", output="sales.xlsx", sources=["raw.pdf"])
generate_doc("Q3 영업 결과 임원 보고", output="deck.pptx", template="brand.pptx",
deck_mode="template_restyle")
r = edit_doc("report.docx", "진행 사항 섹션에 배포 완료 항목을 추가해줘")
print(r.reply, r.operations)
info = analyze_doc("sales.xlsx") # sheets + sample rows
set_doc_text("sales.xlsx", [{"sheet": "매출", "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 carriesdata-e2d-paraand every table celldata-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'sdata-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_sheetwith staleness guards. The hosted preview renders a spreadsheet-style grid (column letters, row numbers, merged ranges, cached formula results) with every cell stampeddata-e2d-cell="B3"— exactly the addressset_celltakes. - 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.
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. Korean-native throughout: Hangul-aware
widths, lang="ko-KR" OOXML runs, bilingual errors.
License
MIT. PPTX core forked from ppt-master (MIT) via edit2ppt.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file edit2docs-0.4.0.tar.gz.
File metadata
- Download URL: edit2docs-0.4.0.tar.gz
- Upload date:
- Size: 5.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9618903f3aaae6cd11a89d7887ec8d6e24697163c679432ec8c9bd1702c32c36
|
|
| MD5 |
e052d26e438df7e86aa394ef254b88f8
|
|
| BLAKE2b-256 |
865d66b07894888f3b767084113949a35038a802e811a908c630c3a57be89c6a
|
Provenance
The following attestation bundles were made for edit2docs-0.4.0.tar.gz:
Publisher:
publish.yml on CocoRoF/edit2docs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
edit2docs-0.4.0.tar.gz -
Subject digest:
9618903f3aaae6cd11a89d7887ec8d6e24697163c679432ec8c9bd1702c32c36 - Sigstore transparency entry: 2055389853
- Sigstore integration time:
-
Permalink:
CocoRoF/edit2docs@8008a471b8c625cab03600c5bd484c1a92fc559c -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/CocoRoF
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8008a471b8c625cab03600c5bd484c1a92fc559c -
Trigger Event:
release
-
Statement type:
File details
Details for the file edit2docs-0.4.0-py3-none-any.whl.
File metadata
- Download URL: edit2docs-0.4.0-py3-none-any.whl
- Upload date:
- Size: 10.6 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad76d3d6f7abb7491d47ef4fa818400eb39ab259f38aa37617018a7cf0f0290b
|
|
| MD5 |
8d05315ec3a0e2c70826d6c6aed59df0
|
|
| BLAKE2b-256 |
478b29cb2f27c3e6c52c0e5b6951a6da8b511ccb8f7f4683d10eb0f43505557d
|
Provenance
The following attestation bundles were made for edit2docs-0.4.0-py3-none-any.whl:
Publisher:
publish.yml on CocoRoF/edit2docs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
edit2docs-0.4.0-py3-none-any.whl -
Subject digest:
ad76d3d6f7abb7491d47ef4fa818400eb39ab259f38aa37617018a7cf0f0290b - Sigstore transparency entry: 2055389915
- Sigstore integration time:
-
Permalink:
CocoRoF/edit2docs@8008a471b8c625cab03600c5bd484c1a92fc559c -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/CocoRoF
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8008a471b8c625cab03600c5bd484c1a92fc559c -
Trigger Event:
release
-
Statement type: