--- id: redlines version: "0.6.1" license: MIT license_treatment: permissive maintenance: active --- # redlines — Compare text, and produce human-readable differences or deltas which look like track changes in Microsoft Word. License: permissive · Maintenance: active · Downloads: 220.5K/mo ## 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 above — 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 pip install redlines uv add redlines 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_current - Install friction: low - Maintenance: active - Downloads: 220.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags text diff comparison, track changes like word, document difference detector, text change visualization, markdown diff output, structured text comparison, diff-and-merge, document-comparison, cli-tool [View on SkillFed](https://skillfed.io/packages/redlines) · [View on PyPI](https://pypi.org/project/redlines/)