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.3.0.tar.gz (19.1 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.3.0-py3-none-any.whl (22.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for adeu-0.3.0.tar.gz
Algorithm Hash digest
SHA256 8a4204a40b6f8697aec620b53d5f4dd1fea0371d115c23d511af15bb448f86ab
MD5 13d3fb6562e366a06f45a2daa18d7651
BLAKE2b-256 48fe7c8c6316633b9eb34b008538459dd33c55dcf759abe6713d9daa7935bfa1

See more details on using hashes here.

Provenance

The following attestation bundles were made for adeu-0.3.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.3.0-py3-none-any.whl.

File metadata

  • Download URL: adeu-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 22.2 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b69fdf150d8684b75da22d04fe605cf4bca24993369c0e56de6b7c94a35be3dd
MD5 88d78d4b3f9d43c886d5bba0e68890f3
BLAKE2b-256 8341f3f0d6cd913202c1eedb9a39b43135af15d5d8bae16ceac1b7b94621835b

See more details on using hashes here.

Provenance

The following attestation bundles were made for adeu-0.3.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