Coder Social home page Coder Social logo

python-wikeddiff's Introduction

Python-wikEdDiff

WikEdDiff is a visual inline-style difference engine with block move support.

The original wikEdDiff is an improved JavaScript diff library that returns html/css-formatted new text version with highlighted deletions, insertions, and block moves. It is also available as a MediaWiki extension, which is a one-to-one synced port with changes and fixes applied to both versions.

Python-wikEdDiff is a port of the original JavaScript library to Python. There were no changes to the algorithm, so all credits go to the original author, Cacycle.

Features

WikEdDiff applies a word-based algorithm that uses unique words as anchor points to identify matching text and moved blocks (Paul Heckel: A technique for isolating differences between files. Communications of the ACM 21(4):264 (1978)).

Additional features:

  • Visual inline style, changes are shown in a single output text
  • Block move detection and highlighting
  • Resolution down to characters level
  • Unicode and multilingual support
  • Stepwise split (paragraphs, lines, sentences, words, characters)
  • Recursive diff
  • Optimized code for resolving unmatched sequences
  • Minimization of length of moved blocks
  • Alignment of ambiguous unmatched sequences to next line break or word border
  • Clipping of unchanged irrelevant parts from the output (optional)
  • Fully customizable
  • Text split optimized for MediaWiki source texts

Notable differences between the Python port and the original JavaScript version:

  • The HTML formatter has been split from the main WikEdDiff class into a separate submodule, along with corresponding settings from the WikEdDiffConfig class.
  • Added an ANSI color formatter and a console demo script (wiked-diff).

Installation

pip install git+git://github.com/lahwaacz/python-wikeddiff.git

License

The Python port (python-wikeddiff) is distributed under the terms of the GNU General Public License v3.0 (see LICENSE).

python-wikeddiff's People

Contributors

lahwaacz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.