{ "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": "# dmp\n\nGoogle's [Diff Match and Patch][DMP] library, packaged for modern Python.\n\n[![build status](https://travis-ci.org/jreese/dmp.svg?branch=master)](https://travis-ci.org/jreese/dmp)\n[![version](https://img.shields.io/pypi/v/dmp.svg)](https://pypi.org/project/dmp)\n[![license](https://img.shields.io/pypi/l/dmp.svg)](https://github.com/facebookincubator/dmp/blob/master/LICENSE)\n\n## Install\n\ndmp is supported on Python 2.7 or Python 3.4 or newer. You can install it from PyPI:\n\n```shell\npython -m pip install dmp\n```\n\n## Usage\n\nTo make it possible to coexist with upstream diff-match-patch (and to reduce\nboilerplate), this makes the normal [API][] available to import as `dmp` instead\nof `diff_match_patch`. The rest of the API remains unchanged, although helper\nfunctions may be added in future updates.\n\nGenerating a patchset (analogous to unified diff) between two texts:\n\n```python\nfrom dmp 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 dmp 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/jreese/dmp", "keywords": "", "license": "Apache", "maintainer": "", "maintainer_email": "", "name": "dmp", "package_url": "https://pypi.org/project/dmp/", "platform": "", "project_url": "https://pypi.org/project/dmp/", "project_urls": { "Homepage": "https://github.com/jreese/dmp" }, "release_url": "https://pypi.org/project/dmp/2018.11.6.1/", "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": "2018.11.6.1" }, "last_serial": 4463297, "releases": { "2018.11.5": [ { "comment_text": "", "digests": { "md5": "027640448c00f191f836ca0d97cd45d8", "sha256": "c315941b9047e1b1a1e377237c31a10b586ab9bd04e33c58359367d57137d7aa" }, "downloads": -1, "filename": "dmp-2018.11.5.tar.gz", "has_sig": false, "md5_digest": "027640448c00f191f836ca0d97cd45d8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 34389, "upload_time": "2018-11-06T02:31:07", "url": "https://files.pythonhosted.org/packages/dc/98/0783b29e43f3d5a39c7470cde2c31ee49ebbfbb7820fbeada794bc1ac6b2/dmp-2018.11.5.tar.gz" } ], "2018.11.6": [ { "comment_text": "", "digests": { "md5": "fc81ce614bf29080d3a63a8d61791bef", "sha256": "1540af80749d02cd1994988c625bf4ac8e6d270e796052500086f27e6d68af8d" }, "downloads": -1, "filename": "dmp-2018.11.6.tar.gz", "has_sig": false, "md5_digest": "fc81ce614bf29080d3a63a8d61791bef", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 58851, "upload_time": "2018-11-07T20:29:57", "url": "https://files.pythonhosted.org/packages/fe/7e/e75f60e271786a64e3cfd15da2f039ee21d80d437fd37f779256908e62d4/dmp-2018.11.6.tar.gz" } ], "2018.11.6.1": [ { "comment_text": "", "digests": { "md5": "0a5bc3cb9e1bcc8a816ae469f72997f6", "sha256": "e1c6d7be4f7b87ddc92ce98dd11429f0aa5d778dc26a7255078a36e3647a2419" }, "downloads": -1, "filename": "dmp-2018.11.6.1.tar.gz", "has_sig": false, "md5_digest": "0a5bc3cb9e1bcc8a816ae469f72997f6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 58839, "upload_time": "2018-11-07T22:37:48", "url": "https://files.pythonhosted.org/packages/da/12/2e811d224adb0c1ecdd3f1fae6deb938bb555c165033ccbbca3daebbf5bc/dmp-2018.11.6.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0a5bc3cb9e1bcc8a816ae469f72997f6", "sha256": "e1c6d7be4f7b87ddc92ce98dd11429f0aa5d778dc26a7255078a36e3647a2419" }, "downloads": -1, "filename": "dmp-2018.11.6.1.tar.gz", "has_sig": false, "md5_digest": "0a5bc3cb9e1bcc8a816ae469f72997f6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 58839, "upload_time": "2018-11-07T22:37:48", "url": "https://files.pythonhosted.org/packages/da/12/2e811d224adb0c1ecdd3f1fae6deb938bb555c165033ccbbca3daebbf5bc/dmp-2018.11.6.1.tar.gz" } ] }