{ "info": { "author": "Neil Fraser", "author_email": "fraser@google.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 6 - Mature", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Libraries", "Topic :: Text Processing" ], "description": "# diff-match-patch\n\nGoogle's [Diff Match and Patch][DMP] library, packaged for modern Python.\n\n[![build status](https://travis-ci.org/diff-match-patch-python/diff-match-patch.svg?branch=master)](https://travis-ci.org/diff-match-patch-python/diff-match-patch)\n[![version](https://img.shields.io/pypi/v/diff-match-patch.svg)](https://pypi.org/project/diff-match-patch)\n[![license](https://img.shields.io/pypi/l/diff-match-patch.svg)](https://github.com/diff-match-patch-python/diff-match-patch/blob/master/LICENSE)\n\n## Install\n\ndiff-match-patch is supported on Python 2.7 or Python 3.4 or newer.\nYou can install it from PyPI:\n\n```shell\npython -m pip install diff-match-patch\n```\n\n## Usage\n\nGenerating a patchset (analogous to unified diff) between two texts:\n\n```python\nfrom diff_match_patch import diff_match_patch\n\ndmp = diff_match_patch()\npatches = dmp.patch_make(text1, text2)\ndiff = dmp.patch_toText(patches)\n```\n\nApplying a patchset to a text can then be done with:\n\n```python\nfrom diff_match_patch import diff_match_patch\n\ndmp = diff_match_patch()\npatches = dmp.patch_fromText(diff)\nnew_text, _ = dmp.patch_apply(patches, text)\n```\n\n## Original README\nThe Diff Match and Patch libraries offer robust algorithms to perform the\noperations required for synchronizing plain text.\n\n1. Diff:\n * Compare two blocks of plain text and efficiently return a list of differences.\n * [Diff Demo](https://neil.fraser.name/software/diff_match_patch/demos/diff.html)\n2. Match:\n * Given a search string, find its best fuzzy match in a block of plain text. Weighted for both accuracy and location.\n * [Match Demo](https://neil.fraser.name/software/diff_match_patch/demos/match.html)\n3. Patch:\n * Apply a list of patches onto plain text. Use best-effort to apply patch even when the underlying text doesn't match.\n * [Patch Demo](https://neil.fraser.name/software/diff_match_patch/demos/patch.html)\n\nOriginally built in 2006 to power Google Docs, this library is now available in C++, C#, Dart, Java, JavaScript, Lua, Objective C, and Python.\n\n### Reference\n\n* [API](https://github.com/google/diff-match-patch/wiki/API) - Common API across all languages.\n* [Line or Word Diffs](https://github.com/google/diff-match-patch/wiki/Line-or-Word-Diffs) - Less detailed diffs.\n* [Plain Text vs. Structured Content](https://github.com/google/diff-match-patch/wiki/Plain-Text-vs.-Structured-Content) - How to deal with data like XML.\n* [Unidiff](https://github.com/google/diff-match-patch/wiki/Unidiff) - The patch serialization format.\n* [Support](https://groups.google.com/forum/#!forum/diff-match-patch) - Newsgroup for developers.\n\n### Languages\nAlthough each language port of Diff Match Patch uses the same API, there are some language-specific notes.\n\n* [C++](https://github.com/google/diff-match-patch/wiki/Language:-Cpp)\n* [C#](https://github.com/google/diff-match-patch/wiki/Language:-C%23)\n* [Dart](https://github.com/google/diff-match-patch/wiki/Language:-Dart)\n* [Java](https://github.com/google/diff-match-patch/wiki/Language:-Java)\n* [JavaScript](https://github.com/google/diff-match-patch/wiki/Language:-JavaScript)\n* [Lua](https://github.com/google/diff-match-patch/wiki/Language:-Lua)\n* [Objective-C](https://github.com/google/diff-match-patch/wiki/Language:-Objective-C)\n* [Python](https://github.com/google/diff-match-patch/wiki/Language:-Python)\n\nA standardized speed test tracks the [relative performance of diffs](https://docs.google.com/spreadsheets/d/1zpZccuBpjMZTvL1nGDMKJc7rWL_m_drF4XKOJvB27Kc/edit#gid=0) in each language.\n\n### Algorithms\nThis library implements [Myer's diff algorithm](https://neil.fraser.name/writing/diff/myers.pdf) which is generally considered to be the best general-purpose diff. A layer of [pre-diff speedups and post-diff cleanups](https://neil.fraser.name/writing/diff/) surround the diff algorithm, improving both performance and output quality.\n\nThis library also implements a [Bitap matching algorithm](https://neil.fraser.name/writing/patch/bitap.ps) at the heart of a [flexible matching and patching strategy](https://neil.fraser.name/writing/patch/).\n\n[DMP]: https://github.com/google/diff-match-patch\n[API]: https://github.com/google/diff-match-patch/wiki/API", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/diff-match-patch-python/diff-match-patch", "keywords": "", "license": "Apache", "maintainer": "", "maintainer_email": "", "name": "diff-match-patch", "package_url": "https://pypi.org/project/diff-match-patch/", "platform": "", "project_url": "https://pypi.org/project/diff-match-patch/", "project_urls": { "Homepage": "https://github.com/diff-match-patch-python/diff-match-patch" }, "release_url": "https://pypi.org/project/diff-match-patch/20181111/", "requires_dist": null, "requires_python": "", "summary": "Repackaging of Google's Diff Match and Patch libraries. Offers robust algorithms to perform the operations required for synchronizing plain text.", "version": "20181111" }, "last_serial": 4475815, "releases": { "20110725": [ { "comment_text": "", "digests": { "md5": "ba57dbcb4b1f5da1bc6308b84bf9ac64", "sha256": "775acb3da1f77c5752934e8c58ebde62cc424deccdf30c653ebb2278c6ae4098" }, "downloads": -1, "filename": "diff-match-patch-20110725.tar.gz", "has_sig": false, "md5_digest": "ba57dbcb4b1f5da1bc6308b84bf9ac64", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29949, "upload_time": "2011-09-08T18:20:05", "url": "https://files.pythonhosted.org/packages/a5/68/642b2fa1877f6a55c5f53a61b1a9def283098a4dbdb8f8dd3416c9b62c7f/diff-match-patch-20110725.tar.gz" } ], "20110725.1": [ { "comment_text": "", "digests": { "md5": "58efc55ae1bbacbe139adff7791f57de", "sha256": "d876417dcf4210765e0c705b97d1b278588bf82304ec6d875e33f61447266300" }, "downloads": -1, "filename": "diff-match-patch-20110725.1.tar.gz", "has_sig": false, "md5_digest": "58efc55ae1bbacbe139adff7791f57de", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 53208, "upload_time": "2011-09-08T19:09:19", "url": "https://files.pythonhosted.org/packages/25/8f/213d4eee154f3450c37e79a0ed41027adbf14f0649bc9721b859a229e31b/diff-match-patch-20110725.1.tar.gz" } ], "20120106": [ { "comment_text": "", "digests": { "md5": "8de3bc2282fda5999f45fa4b576ad70f", "sha256": "78476e0057827fefdcebd991bec48e56c2576bf9253dfc1486c837455c45757a" }, "downloads": -1, "filename": "diff-match-patch-20120106.tar.gz", "has_sig": false, "md5_digest": "8de3bc2282fda5999f45fa4b576ad70f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 54099, "upload_time": "2012-04-07T22:40:53", "url": "https://files.pythonhosted.org/packages/bd/af/bdde901de3ce671ce8130fc8c67fcd2a5cea41c4c3daed924f75449fd9b7/diff-match-patch-20120106.tar.gz" } ], "20121119": [ { "comment_text": "", "digests": { "md5": "08e02cad82dda942b09ee248772fe143", "sha256": "9dba5611fbf27893347349fd51cc1911cb403682a7163373adacc565d11e2e4c" }, "downloads": -1, "filename": "diff-match-patch-20121119.tar.gz", "has_sig": false, "md5_digest": "08e02cad82dda942b09ee248772fe143", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 54113, "upload_time": "2013-12-17T11:30:28", "url": "https://files.pythonhosted.org/packages/22/82/46eaeab04805b4fac17630b59f30c4f2c8860988bcefd730ff4f1992908b/diff-match-patch-20121119.tar.gz" } ], "20181111": [ { "comment_text": "", "digests": { "md5": "95e1679ec81b7761d4bfe516e6a49b42", "sha256": "a809a996d0f09b9bbd59e9bbd0b71eed8c807922512910e05cbd3f9480712ddb" }, "downloads": -1, "filename": "diff-match-patch-20181111.tar.gz", "has_sig": false, "md5_digest": "95e1679ec81b7761d4bfe516e6a49b42", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 58554, "upload_time": "2018-11-12T02:41:57", "url": "https://files.pythonhosted.org/packages/f0/2a/5ba07def0e9107d935aba62cf632afbd0f7c723a98af47ccbcab753d2452/diff-match-patch-20181111.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "95e1679ec81b7761d4bfe516e6a49b42", "sha256": "a809a996d0f09b9bbd59e9bbd0b71eed8c807922512910e05cbd3f9480712ddb" }, "downloads": -1, "filename": "diff-match-patch-20181111.tar.gz", "has_sig": false, "md5_digest": "95e1679ec81b7761d4bfe516e6a49b42", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 58554, "upload_time": "2018-11-12T02:41:57", "url": "https://files.pythonhosted.org/packages/f0/2a/5ba07def0e9107d935aba62cf632afbd0f7c723a98af47ccbcab753d2452/diff-match-patch-20181111.tar.gz" } ] }