{"id":17247617,"url":"https://github.com/joshdata/fast_diff_match_patch","last_synced_at":"2025-04-06T10:11:58.232Z","repository":{"id":45056133,"uuid":"2161723","full_name":"JoshData/fast_diff_match_patch","owner":"JoshData","description":"Python package for Google's diff-match-patch native C++ implementation.","archived":false,"fork":false,"pushed_at":"2024-06-13T15:12:18.000Z","size":7916,"stargazers_count":74,"open_issues_count":1,"forks_count":27,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-30T08:11:03.723Z","etag":null,"topics":["diff","python"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/fast-diff-match-patch/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JoshData.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-08-05T17:46:21.000Z","updated_at":"2024-12-12T19:19:40.000Z","dependencies_parsed_at":"2024-04-09T16:45:39.015Z","dependency_job_id":"042a88c8-0ff1-4e4c-8947-68adf9c12393","html_url":"https://github.com/JoshData/fast_diff_match_patch","commit_stats":{"total_commits":70,"total_committers":10,"mean_commits":7.0,"dds":0.3142857142857143,"last_synced_commit":"b69794382df1e6642894d7f97dd0bdcec5831694"},"previous_names":["joshdata/diff_match_patch-python"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoshData%2Ffast_diff_match_patch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoshData%2Ffast_diff_match_patch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoshData%2Ffast_diff_match_patch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoshData%2Ffast_diff_match_patch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JoshData","download_url":"https://codeload.github.com/JoshData/fast_diff_match_patch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247464222,"owners_count":20942970,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["diff","python"],"created_at":"2024-10-15T06:38:28.480Z","updated_at":"2025-04-06T10:11:58.210Z","avatar_url":"https://github.com/JoshData.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"fast\\_diff\\_match\\_patch: Python package wrapping the C++ implementation of google-diff-match-patch\n===================================================================================================\n\nThis is a Python 3.6+ package that wraps google-diff-match-patch\\'s C++\nimplementation for performing very fast string comparisons. This package\nwas previously known as diff\\_match\\_patch\\_python.\n\ngoogle-diff-match-patch is a Google library for computing differences\nbetween text files (http://code.google.com/p/google-diff-match-patch).\nThere are implementations in various languages. Although there is a Python\nport, it's slow on very large documents, and I have a need for speed. I\nwanted to use the C++ implementation, but I'm a Python guy so I'd\nprefer to use it from Python.\n\nGoogle's library depends on Qt 4, so some other folks rewrote it using\nthe standard C++ library classes instead, making it more portable.\nThat's at https://github.com/leutloff/diff-match-patch-cpp-stl. This\npackage uses that library.\n\nExample\n-------\n\nFirst:\n\n    pip3 install fast_diff_match_patch\n\nThen write (this is Python 3):\n\n    from fast_diff_match_patch import diff\n\n    changes = diff(\"Hello world.\", \"Goodbye moon.\")\n\n    for op, length in changes:\n        if op == \"-\": print (\"next\", length, \"characters are deleted\")\n        if op == \"=\": print (\"next\", length, \"characters are in common\")\n        if op == \"+\": print (\"next\", length, \"characters are inserted\")\n\nThe two textual arguments can be either strings or bytes.\n\nSome keyword arguments are also available:\n\n`timelimit` (default 0) gives the maximum running time in seconds if you\nwant to ensure the result comes quickly. According to the Google docs,\nthe diff will stop working after the time is exceeded and will return a\nvalid diff, but it might not be the best one. `checklines` is also a\nGoogle thing and might speed up diffs that are over lined-based text\nlike code.\n\n`checklines` (default `True`) is the same argument in the diff_main\nsubroutine of the main library.\n\n`cleanup` (default `\"Semantic\"`) is `\"Semantic\"`, `\"Efficiency\"`, or `\"No\"`\nto run the corresponding cleanup subroutine after performing the diff.\n\nSet `counts_only` (default `True`) to `False` to have the returned value be an array of\ntuples of operations and corresponding strings rather than operations\nand the lengths of those strings.\n\nIf `as_patch` (default `False`) is `True`, the diff is returned in patch format\nas a string.\n\nThe Global Interpreter Lock (GIL) is released while performing the diff\nso that this library can be used in a multi-threaded application.\n\n\nChangelog\n---------\n\n### Version 2.0.1\n\n* Diffs of byte strings are now null-character-safe.\n* Fixed `as_patch` argument.\n\n### Version 2.0.0\n\n* The import has been renamed from `diff_match_patch` to `fast_diff_match_patch` to avoid an import naming collision with https://pypi.org/project/diff-match-patch/ and the package name has been updated to match the import name.\n* In previous versions of this package, separate `diff_bytes` (Py3), `diff_unicode` and `diff_str` (Py2)\nmethods were available. They have been merged into a single `diff` method that checks the type of the arguments passed.)\n* `cleanup_semantic` has been renamed to `cleanup`, which takes one of three options (see above)\n* On Windows, an exception will be thrown if a string has characters outside of the Basic Multilingual Plane.\n\nBuilding from source\n--------------------\n\nTo build from these sources, you will need:\n\n-   Python development headers and the setuptools package\n    (Debian packages `python3-dev`, `python3-setuptools`)\n-   The diff-match-patch library, which you can clone using\n    `git submodule update --init`.\n\nThen build/install the binary module using:\n\n    python setup.py build\n    python setup.py install\n\n\nFor package maintainers\n-----------------------\n\nTo build everything (for testing):\n\n    git submodule update \u0026\u0026 rm -rf build \u0026\u0026 python3 setup.py build\n\nTo test without installing:\n\n    PYTHONPATH=build/lib.linux-x86_64-*/ python3 -m unittest\n\nRelease packages (wheels and a source distribution) are built using GitHub Actions\nin this repository. To upload them as a new release to PyPi, download the artifact\nand extract the files to a new directory, and:\n\n```sh\npython3 -m pip install --upgrade twine\npython3 -m twine upload -u __token__ path-to-artifact-files/*\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshdata%2Ffast_diff_match_patch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoshdata%2Ffast_diff_match_patch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshdata%2Ffast_diff_match_patch/lists"}