Skip to main content

Automated DOCX Redlining Engine

Project description

Adeu: AI Redlining Engine

Adeu allows AI Agents and LLMs to "Track Changes" in Microsoft Word documents.

Most LLMs output raw text or Markdown. Professionals need w:ins (insertions) and w:del (deletions) to review changes inside Word. adeu lib shows a Word document in an LLM and human understandable textual format and reflects changes made to it to the actual word document.

It creates a "Virtual DOM" of your document, letting AI apply surgical edits without breaking your formatting, numbering, or headers.


Installation

Adeu is available on PyPI.

pip install adeu

Ways to Use Adeu

1. As MCP Server (No Code Required)

If you use an agentic system such as Claude Desktop, you can connect Adeu directly. This lets you handle contracts in Claude and say: "Change the Governing Law to Delaware and generate me the redline."

Add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "adeu": {
      "command": "uvx",
      "args": ["adeu", "adeu-server"]
    }
  }
}

(Requires uv installed on your machine)

2. For "Vibe Coding" & Python Scripts

Building your own Agentic AI tool in Cursor, Replit, or Windsurf: Adeu is the engine that handles the document manipulation for you.

from adeu import RedlineEngine, DocumentEdit
from io import BytesIO

# 1. Load your contract
with open("NDA.docx", "rb") as f:
    doc_stream = BytesIO(f.read())

# 2. Define the change (Usually this comes from your LLM response)
edit = DocumentEdit(
    target_text="State of New York",
    new_text="State of Delaware",
    comment="Changed governing law to neutral jurisdiction."
)

# 3. Apply the Redline
engine = RedlineEngine(doc_stream, author="AI Associate")
engine.apply_edits([edit])

# 4. Save
with open("NDA_Redlined.docx", "wb") as f:
    f.write(engine.save_to_stream().getvalue())

3. The CLI

Quickly extract text or apply patches from your terminal.

# Compare two docs and see a summary
adeu diff v1.docx v2.docx

# Apply a JSON list of edits to a doc
adeu apply agreement.docx edits.json

Why Adeu?

  • Native Redlines: Generates real Microsoft Word Track Changes. You can "Accept" or "Reject" them in Word.
  • Format Safe: Adeu preserves your complex numbering, headers, footers, and images. It only touches the text you change.
  • Native Comments: Supports adding comments (Review Pane) linked to specific text ranges.
  • Intelligent Mapping: Handles the messy internal XML of Word documents (e.g., when "Contract" is split into ["Con", "tract"] by spellcheck).

License

MIT License. Open source and free to use in commercial legal tech applications.

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

adeu-0.4.0.tar.gz (21.7 kB view details)

Uploaded Source

Built Distribution

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

adeu-0.4.0-py3-none-any.whl (24.8 kB view details)

Uploaded Python 3

File details

Details for the file adeu-0.4.0.tar.gz.

File metadata

  • Download URL: adeu-0.4.0.tar.gz
  • Upload date:
  • Size: 21.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for adeu-0.4.0.tar.gz
Algorithm Hash digest
SHA256 2ddeee1a2a650bc4898d6e1b325fae5baae0d65c7e5bf5d5554bd9695af3866c
MD5 172bc7e26f77e83026086f1a608d0f0d
BLAKE2b-256 c994a620ca1240caecf3505aaebd342d545f51f0c745e22a3efb9fb2836f9ff8

See more details on using hashes here.

Provenance

The following attestation bundles were made for adeu-0.4.0.tar.gz:

Publisher: release.yml on dealfluence/adeu

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

File details

Details for the file adeu-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: adeu-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 24.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for adeu-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 37eed0326891385fc28667a20ccb30b9f5c922b74162f819defa0b01610d10d3
MD5 343370526852cf41b470a29a74063100
BLAKE2b-256 7d6a76056f451005085638595fc2cff7a08b827cc4c312d85df107a3f278abfa

See more details on using hashes here.

Provenance

The following attestation bundles were made for adeu-0.4.0-py3-none-any.whl:

Publisher: release.yml on dealfluence/adeu

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