{ "info": { "author": "Theo (Lattay) Cavignac", "author_email": "theo.cavignac@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Information Technology", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# ShortDiff\n\nThis is a Python implementation of a diff algorithm.\nIt aims at producing one-way as-short-as-possible patch \nto go from a file to another.\nThis is useful to keep track of modifications in a text file without\nkeeping a copy of each state (this is the easy part of version control).\nThis produce shorter patch than any output from the GNU diff tool.\nSince it is one-way only, the patch to go from A to B does not permit to\nto go from B to A.\n\n# Disclaimer\n\nThis algorithm have a time complexity of O(N\\*M) (where N and M are the\nnumber of line of each file) and is implemented in pure python.\nThere performances are not great.\nYou should probably not use it in any serious project.\nI wrote it for educational purpose and I use it in a really small\nscale project.\n\nStill for educational project there are more naive version in the archive\ndirectory. The final module is a refinment of these.\n\n# Installation\n\nUse pip to install it or copy this directory in a relevant place\nif you know what you are doing.\n\n`pip install ShortDiff`\n\n# Usage\n\n## CLI\n\nCreate a patch\n\n```\npython -m ShortDiff diff FILA_A [FILE_B]\n```\n\nCreate the patch to go from A to B. If FILE_B is ommited, its content\nis expected from the standard input.\nOutput the patch to standard output.\n\nApply a patch\n\n```\npython -m ShortDiff patch PATCH [FILE]\n```\nApply PATCH to FILE. If FILE is ommited, apply patch to standard input.\nResult is printed to standard output.\n\n## API\n\nFunctions can be imported from the module to be used in other apps.\nUseful functions include:\n\n- `differ(old, new)`: (low level) take to arbitrary sequences and return the Levenstein distance and\n the path from one to another as a sequence of pairs (position in old, position in new).\n If the position in old is the same in two consecutive pair, it correspond to an insertion.\n If the position in new is the same in two consecutive pair, it correspond to a deletion.\n Else it correspond to an unmodified chunk.\n Path is made so to consecutive operations cannot be of the same kind (a deletion cannot be\n immediatly followed by another deletion).\n\n- `get_chunks(old_txt, new_txt)`: (high level) generator taking two strings and compute the live diff.\n It yields 4 elements tuples `(kind, start, stop, content)`. `kind` is one of `'d'` (deletion) `'i'` (insertion)\n and `'k'` (keep/unmodified). `start` and `stop` are the line number boundaries of the chunk concerned by the \n operations in `old_txt` for deletion and keep and in `new_txt` for insertion. `content` is the list of lines of\n the chunk.\n\n- `create_patch(old_txt, new_txt)`: (high level) return the patch as printed by the CLI\n- `apply_patch(old_txt, patch)`: (high level) return the result of applying `patch` to `old_txt`\n\n\n\n\n", "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/Lattay/ShortDiff", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "ShortDiff", "package_url": "https://pypi.org/project/ShortDiff/", "platform": "", "project_url": "https://pypi.org/project/ShortDiff/", "project_urls": { "Homepage": "https://github.com/Lattay/ShortDiff" }, "release_url": "https://pypi.org/project/ShortDiff/0.1.3/", "requires_dist": null, "requires_python": "", "summary": "A simple one way diff tool", "version": "0.1.3" }, "last_serial": 5737146, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "8b7db6b7cc5b20a3fc2f2d1ba1079d8d", "sha256": "dc0afcef8d8749cf9f4deb85841b8e58667e6306a60e2b353c49b2fe6d29825d" }, "downloads": -1, "filename": "ShortDiff-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "8b7db6b7cc5b20a3fc2f2d1ba1079d8d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3883, "upload_time": "2018-08-29T16:14:17", "url": "https://files.pythonhosted.org/packages/00/60/cc12c4953c484a27dca22f361f8b4265fa78a3aa73eed35358f5cd82969d/ShortDiff-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9b5aa320940abae91903f2b209277e23", "sha256": "9e701d5e8474d7559857424920be112e8af4e8423bde329f11ed220699cc569a" }, "downloads": -1, "filename": "ShortDiff-0.1.0.tar.gz", "has_sig": false, "md5_digest": "9b5aa320940abae91903f2b209277e23", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3273, "upload_time": "2018-08-29T16:14:18", "url": "https://files.pythonhosted.org/packages/fb/73/e0ea92cd904ec94428ef48d69760785cb215aef50495c778cf4c7c33363f/ShortDiff-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "b16a0b73d3d415ae4074cb2be7ada76c", "sha256": "1e64d9c628f0d5ccfa29646c644efe7f1763e3c2979d0f4b8d47766be4f76748" }, "downloads": -1, "filename": "ShortDiff-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "b16a0b73d3d415ae4074cb2be7ada76c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3890, "upload_time": "2018-08-29T17:03:28", "url": "https://files.pythonhosted.org/packages/95/5b/6b3c875d1954f4be843127b75fcc55e358e1a0aa86b4f247f354eda13c3e/ShortDiff-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "10d4b5bdbbc6d44b7da7d12d72f0fecd", "sha256": "7af6438ee9a6141eb956443d92c675b0bd28b11e7a3f3419233d0734ae2133b7" }, "downloads": -1, "filename": "ShortDiff-0.1.1.tar.gz", "has_sig": false, "md5_digest": "10d4b5bdbbc6d44b7da7d12d72f0fecd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3275, "upload_time": "2018-08-29T17:03:29", "url": "https://files.pythonhosted.org/packages/c6/f6/f2a04faf88d44617bdf2b895d0f579228e09ad49da99fb6e03f2bdad6fb7/ShortDiff-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "4b77df8d19eec901311daa11c86d86af", "sha256": "fe7e16e5002ece85b263c9fa7e0330acfdd53fcd918fc14e0867eee76dbd4d1a" }, "downloads": -1, "filename": "ShortDiff-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "4b77df8d19eec901311daa11c86d86af", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3874, "upload_time": "2018-09-10T16:52:38", "url": "https://files.pythonhosted.org/packages/5a/55/1a201eb32afc41234e3a2b148fe6b3f1a4585172affb7cdef4d3af9575c2/ShortDiff-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f8ee4119329672ac3e189b375b5e8215", "sha256": "ae615494374ff3b84ec37cdd6e590dfa9564dd61655cb8a2f5e04326049a202e" }, "downloads": -1, "filename": "ShortDiff-0.1.2.tar.gz", "has_sig": false, "md5_digest": "f8ee4119329672ac3e189b375b5e8215", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3257, "upload_time": "2018-09-10T16:52:40", "url": "https://files.pythonhosted.org/packages/0b/a4/04718af4bf1aa2a351bd7a8b2b8ba77768c5c765ec45d9f1efc9aada6887/ShortDiff-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "cbd46fcd92f6416670033d0452695402", "sha256": "4c9c12cf44a5ea4ac9535ece4fdc7d7c5938e7d58ea347b1a4b9cef251cd3c7b" }, "downloads": -1, "filename": "ShortDiff-0.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "cbd46fcd92f6416670033d0452695402", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6034, "upload_time": "2019-08-27T14:38:21", "url": "https://files.pythonhosted.org/packages/de/36/53fec31d5ecb9f73a9b8fcf962fb46040744c2198c2da28a0e1dac033052/ShortDiff-0.1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "97017383009fb768ce0b30460d549b4e", "sha256": "ae548193dafe0a4200bd9baf959c88f99f06b64ea68837c32bcab3feab409718" }, "downloads": -1, "filename": "ShortDiff-0.1.3.tar.gz", "has_sig": false, "md5_digest": "97017383009fb768ce0b30460d549b4e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4637, "upload_time": "2019-08-27T14:38:22", "url": "https://files.pythonhosted.org/packages/ec/50/77f9c607201f6158829fda1cee65b47da255567281627bf10758bb56a572/ShortDiff-0.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "cbd46fcd92f6416670033d0452695402", "sha256": "4c9c12cf44a5ea4ac9535ece4fdc7d7c5938e7d58ea347b1a4b9cef251cd3c7b" }, "downloads": -1, "filename": "ShortDiff-0.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "cbd46fcd92f6416670033d0452695402", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6034, "upload_time": "2019-08-27T14:38:21", "url": "https://files.pythonhosted.org/packages/de/36/53fec31d5ecb9f73a9b8fcf962fb46040744c2198c2da28a0e1dac033052/ShortDiff-0.1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "97017383009fb768ce0b30460d549b4e", "sha256": "ae548193dafe0a4200bd9baf959c88f99f06b64ea68837c32bcab3feab409718" }, "downloads": -1, "filename": "ShortDiff-0.1.3.tar.gz", "has_sig": false, "md5_digest": "97017383009fb768ce0b30460d549b4e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4637, "upload_time": "2019-08-27T14:38:22", "url": "https://files.pythonhosted.org/packages/ec/50/77f9c607201f6158829fda1cee65b47da255567281627bf10758bb56a572/ShortDiff-0.1.3.tar.gz" } ] }