
Looks promising for document editing with your agent
Today, we release Paper Office, a suite of Python packages that allow agents to manipulate Word, PowerPoint, and Excel files with added safety, correctness and breadth, building on legacy open source packages: python-do…
以下正文同步自 Hacker News,版权归原站所有,已转换为易读排版。
paper-pptx
paper-xlsx
Today, we release Paper Office, a suite of Python packages that allow agents to manipulate Word, PowerPoint, and Excel files with added safety, correctness and breadth, building on legacy open source packages: python-docx, python-pptx and OpenPyxl. Across five models and 61 tasks, Paper packages plus guidance passed 92.5% of trials, versus 80.7% for upstream packages without skills and 69.5% with Anthropic's comparable Office skills. Agents also wrote code to edit Office file internals directly in just 1.6% of Paper runs, compared with 78.7% without skills and 50.5% with Anthropic skills. We note that basic software, in addition to prompt, skills, and tools, remains an important lever for harness optimization.
Agents still have low penetration in the daily work of consultants, lawyers, bankers, and operators. We believe the bottleneck to professional adoption is fidelity to real workflows. Agents dont manipulate existing documents with the same techniques that humans do, and the resulting decks, sheets, and documents sit in an uncanny valley that aren't fit for client consumption.
DOCX, PPTX, and XLSX files use Office Open XML (OOXML): each is a ZIP archive containing XML files, images, and other resources linked together, rather than a single text file. Editing them means keeping those parts and their relationships consistent, so even a small visible change can require updates in several places.
The standard Python Office libraries (python-docx, python-pptx, and openpyxl) are mature construction tools with years of accumulated edge cases, and most production agents often rely on these libraries for doc manipulation. However, they haven't seen updates in several years and, for many important workflows, lack feature breadth and correctness contracts. In some cases, models opt for other Javascript based packages or HTML-to-document processes to more easily represent and manipulate classic office documents, but these intermediate representations are lossy and often corrupt existing, brownfield work.
We forked, patched, and reworked the APIs of the standard Python Office libraries to support a variety of agent-first use cases, improving correctness and expanding feature completeness.
When the package cannot express those operations, the model falls through to wrapper scripts and raw OOXML, polluting its context with package mechanics. This frequently leads to silent regressions in comment anchors, chart workbooks, fields, custom XML, formula dependencies and so on.
Paper Office keeps the familiar imports and extends the packages underneath them. Existing model priors remain useful: import docx, from pptx import Presentation, and import openpyxl still work.
The additions expose hidden structure as typed, machine-readable data, validate targets before supported edits, provide package-preserving save paths, report bounded changes, and refuse explicitly when an operation cannot be handled safely.
paper-docx extends python-docx with document-wide search, tracked edits, comments, composition, and reversible redlines, allowing agents to revise and review existing Word documents using Word's native review model.
The fork also traverses body text, headers, footers, footnotes, endnotes, comments, tracked insertions, content controls, and text boxes through docx.story, with revision views and counts of blind regions it cannot read.
paper-pptx extends python-pptx with inherited-format inspection, native bullets, guarded slide and shape edits, cross-deck composition, and structural diffs, enabling surgical diffing of PowerPoint files.
Intake is hardened too: the package rejects ambiguous or unsafe ZIP archives, including duplicate or case-colliding members, noncanonical paths, encryption, and unsupported compression. Path-based saves write a sibling temporary package and atomically replace the destination after serialization succeeds.
paper-xlsx extends openpyxl with package-preserving saves, reference-aware structural edits, edit receipts, and LibreOffice-backed recalculation, supporting diffs that account for formulas, dependencies, and package content.
Path saves build the archive on disk, validate ZIP consistency, and fsync before rename. Callers, rather than fixed package-wide size or compression-ratio limits, control resource budgets.
The reported comparison covers 61 tasks: 27 DOCX, 15 PPTX, and 19 XLSX. It covers a wide range of existing-file workflows involving fragmented text, revisions, comment threads, numbering, fields, slide relationships, embedded workbooks, template lineage, formulas, names, charts, and dependent ranges, alongside two creation controls.
We evaluated five models: Opus 5, GLM 5.3 Flash, GPT 5.6 Sol, Grok 4.6, and DeepSeek v4.1 Flash. Each model-task pair is rolled out under each of three conditions:
All conditions ran through OpenCode in Harbor, with identical task prompts across conditions.
Both upstream conditions used the same pinned versions: python-docx==1.2.0, python-pptx==1.0.2, and openpyxl==3.1.5.
Paper passes 282/305 trials (92.5%), compared with 246/305 (80.7%) upstream raw and 212/305 (69.5%) with Anthropic skills.
Against no skills, Paper improves success in 12 of 15 model-by-format slices, ties on DeepSeek PPTX and XLSX, and trails by one task on GLM PPTX. Pooled across models:
The main difference was who handled the file's internal bookkeeping. In the reviewed upstream runs, agents often wrote code to reconnect comments, copy slide relationships, or repair spreadsheet references and caches. Some did this successfully. Paper usually handled that work through its APIs, although agents still inspected XML to check the result. Across all 915 retained runs, explicit raw ZIP editing code appeared far more often with upstream packages:
The recurring failure in the reviewed cases was an incomplete edit: the requested text or numbers were right, but a comment link, dependent range, or unrelated part of the file was not. Paper helped with those connected changes.
We analyzed the selected run for each model, task, and condition across the 61 tasks. The chart counts a run once if agent-submitted code contains an explicit .writestr(...) call. We inspected source submitted through inline Python, script heredocs, file writes, edits, and added patch lines, excluding returned documentation and library source.
Across the trials, Paper found formula errors that upstream runs missed, kept comment replies attached when a thread was edited, and updated spreadsheet validation and formatting ranges when a column was inserted. Even if the edit was simple to make, without Paper the model often corrupted the surrounding document in subtle ways.
The following examples compare how the same model completed the same task with each setup.
DeepSeek was asked to extend an existing comment, add a reply, and mark the conversation as resolved while leaving another discussion open. Using the upstream package without skills, it added the requested text but did not correctly update the links that connect the replies and record the conversation's resolved status. Paper maintained those links through its comment APIs, while the agent using Anthropic skills updated them manually. Both passed, while the version without skills failed.
Grok was asked to copy a slide and change the copy's chart and speaker notes without affecting the original. All three setups passed the checks for keeping the chart and notes independent. The copies made with the upstream package retained internal creation identifiers from the original slide, and this was their only failed check. Paper assigned new identifiers when copying the slide and passed all checks.
GLM was asked to add a forecast quarter and update the chart and annual totals. All three setups reached the correct revenue of 485 and EBITDA of 111. With the upstream package, some input-validation and formatting rules still covered the old cell ranges, and the agent without skills left the old quarter in the chart. Paper updated the dependent ranges, and the agent produced a workbook that passed all checks. The other two setups got the totals right but left parts of the workbook out of date.
A separate spreadsheet task asked GPT 5.6 Sol to identify formula errors without changing the file. Using Paper's scan_errors(), it found all four required errors in the formulas and stored calculation results. In both upstream setups, it found only two. The Paper result passed, and the workbook remained unchanged.
Across five models, Paper packages increased complete task success across the board, and highlight software as an important lever to improve agent performance for knowledge work problems.
We use Paper Office by default inside the Feather harness. Learn more about the packages here.
正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。