skillfed

redlines

Compare text, and produce human-readable differences or deltas which look like track changes in Microsoft Word.

redlines v0.6.1 220.5K downloads/30d#9,298 on PyPI157
Permissive license MIT Active released

What it is and what it does

Redlines is a text-comparison library that identifies and visualizes differences between two strings or documents. It produces output formatted like Microsoft Word's track changes, making edits immediately visible with strike-throughs for deletions and highlights for additions. The library supports multiple output formats—JSON (with structured change data and statistics), Markdown, HTML, and rich terminal display—allowing both human-readable visualization and programmatic access to change metadata.

The package provides a single `Redlines` class for comparison work, available both as a Python API and a command-line tool. It includes optional advanced processors: `NupunktProcessor` for intelligent sentence-level tokenization (useful for documents with abbreviations, URLs, and citations) and support for additional statistics via the levenshtein dependency. The library targets Python 3.10 and later and depends on click and rich for CLI and terminal rendering.

Use it for:

  • Visualize edits in legal or technical documents where precise change tracking is required.
  • Generate structured JSON diffs for AI agents or automation systems to process and act on text modifications.
  • Display side-by-side or inline text changes in web applications or documentation tools using HTML or Markdown output.
  • Compare versions of configuration files, code comments, or documentation to audit what changed between revisions.
  • Integrate with ChatGPT or other LLM workflows to show users exactly what text transformations an AI made.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Redlines compares two strings or text documents and produces structured output showing differences with strike-throughs and highlights, similar to Microsoft Word's track changes, in JSON, Markdown, HTML, or terminal-rich formats.

Yes. Redlines is actively maintained, has no known vulnerabilities, installs with low friction, and solves a specific problem (text comparison with Word-like track changes) that is not trivial to implement from scratch. The MIT license poses no restrictions. Install it if you need to compare text and display or process the differences programmatically.

Install

redlines on PyPI

pip

pip install redlines

uv

uv add redlines

poetry

poetry add redlines

Installing redlines

Before you install

Low friction: pure Python wheel with four lightweight runtime dependencies (click, click-default-group, rich, rich-click). Repository is active with recent commits and no archived status.

License in practice

MIT license permits unrestricted use, modification, and distribution with minimal attribution requirements—suitable for commercial and proprietary projects.

Quickstart

pip install redlines

from redlines import Redlines

test = Redlines(
    "The quick brown fox jumps over the lazy dog.",
    "The quick brown fox walks past the lazy dog.",
    markdown_style="none"
)
print(test.output_markdown)

Requires Python 3.10 or later; Python 3.8 and 3.9 support has been dropped.

Verify before relying

  • Performance characteristics and scalability limits for very large documents are not specified in the fact sheet.
  • Whether optional dependencies (nupunkt, levenshtein) are automatically installed or must be explicitly requested.
  • Exact behavior and output format differences between the four supported output modes (JSON, Markdown, HTML, rich).

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 4 — click-default-group, click, rich-click, rich
Maintenance actively maintained — 263 days since the last release
Last repo commit
First released
Downloads 220,534/month — #9,298 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: redlines-0.6.1-py3-none-any.whl

Keywords: cli, diff, document-comparison, redlines, text-comparison, track-changes

Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

text diff comparisontrack changes like worddocument difference detectortext change visualizationmarkdown diff outputstructured text comparison
diff-and-mergedocument-comparisoncli-tool

More Text Processing packages