deltas


Namedeltas JSON
Version 0.7.0 PyPI version JSON
download
home_pagehttps://github.com/halfak/deltas
SummaryAn experimental diff library for generating operation deltas that represent the difference between two sequences of comparable items.
upload_time2021-07-08 17:23:02
maintainer
docs_urlhttps://pythonhosted.org/deltas/
authorAaron Halfaker
requires_python
licenseMIT
keywords
VCS
bugtrack_url
requirements yamlconf
Travis-CI
coveralls test coverage No coveralls.
            Deltas
======

An open licensed (MIT) library for performing generating deltas (A.K.A sequences
of operations) representing the difference between two sequences of comparable
tokens.

* **Installation:** ``pip install deltas``
* **Repo**: http://github.com/halfak/Deltas
* **Documentation**: http://pythonhosted.org/deltas
* Note this library requires Python 3.3 or newer

This library is intended to be used to make experimental difference detection
strategies more easily available.  There are currently two strategies available:

``deltas.sequence_matcher.diff(a, b)``:
    A shameless wrapper around `difflib.SequenceMatcher` to get it to work
    within the structure of *deltas*.
``deltas.segment_matcher.diff(a, b, segmenter=None)``:
    A generalized difference detector that is designed to detect block moves
    and copies based on the use of a ``Segmenter``.

:Example:
    >>> from deltas import segment_matcher, text_split
    >>>
    >>> a = text_split.tokenize("This is some text.  This is some other text.")
    >>> b = text_split.tokenize("This is some other text.  This is some text.")
    >>> operations = segment_matcher.diff(a, b)
    >>>
    >>> for op in operations:
    ...     print(op.name, repr(''.join(a[op.a1:op.a2])),
    ...           repr(''.join(b[op.b1:op.b2])))
    ...
    equal 'This is some other text.' 'This is some other text.'
    insert ' ' '  '
    equal 'This is some text.' 'This is some text.'
    delete '  ' ''



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/halfak/deltas",
    "name": "deltas",
    "maintainer": "",
    "docs_url": "https://pythonhosted.org/deltas/",
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Aaron Halfaker",
    "author_email": "aaron.halfaker@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/fc/71/853179e2b7f8b068c53d336ff2473fcd00f1b63333d9d71f76b4245d68ef/deltas-0.7.0.tar.gz",
    "platform": "",
    "description": "Deltas\n======\n\nAn open licensed (MIT) library for performing generating deltas (A.K.A sequences\nof operations) representing the difference between two sequences of comparable\ntokens.\n\n* **Installation:** ``pip install deltas``\n* **Repo**: http://github.com/halfak/Deltas\n* **Documentation**: http://pythonhosted.org/deltas\n* Note this library requires Python 3.3 or newer\n\nThis library is intended to be used to make experimental difference detection\nstrategies more easily available.  There are currently two strategies available:\n\n``deltas.sequence_matcher.diff(a, b)``:\n    A shameless wrapper around `difflib.SequenceMatcher` to get it to work\n    within the structure of *deltas*.\n``deltas.segment_matcher.diff(a, b, segmenter=None)``:\n    A generalized difference detector that is designed to detect block moves\n    and copies based on the use of a ``Segmenter``.\n\n:Example:\n    >>> from deltas import segment_matcher, text_split\n    >>>\n    >>> a = text_split.tokenize(\"This is some text.  This is some other text.\")\n    >>> b = text_split.tokenize(\"This is some other text.  This is some text.\")\n    >>> operations = segment_matcher.diff(a, b)\n    >>>\n    >>> for op in operations:\n    ...     print(op.name, repr(''.join(a[op.a1:op.a2])),\n    ...           repr(''.join(b[op.b1:op.b2])))\n    ...\n    equal 'This is some other text.' 'This is some other text.'\n    insert ' ' '  '\n    equal 'This is some text.' 'This is some text.'\n    delete '  ' ''\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "An experimental diff library for generating operation deltas that represent the difference between two sequences of comparable items.",
    "version": "0.7.0",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "843d58ca08371d0053d0539a4dd33e55",
                "sha256": "0f05c3c10b72135aed34cb56126fc4ea0678469067f5638c2af0db01c12fc48f"
            },
            "downloads": -1,
            "filename": "deltas-0.7.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "843d58ca08371d0053d0539a4dd33e55",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 36116,
            "upload_time": "2021-07-08T17:22:10",
            "upload_time_iso_8601": "2021-07-08T17:22:10.997297Z",
            "url": "https://files.pythonhosted.org/packages/b8/52/4d7885511444177409210bb2099fadb82f4ec1c9422aac3011741fa78ca3/deltas-0.7.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "2f4ffc0635c24d04032ef195aad4795e",
                "sha256": "ada14ba6be4bb6360c3f5229c0bdd96e3de654b435fbf8a137528c43c6e23204"
            },
            "downloads": -1,
            "filename": "deltas-0.7.0.tar.gz",
            "has_sig": false,
            "md5_digest": "2f4ffc0635c24d04032ef195aad4795e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 21509,
            "upload_time": "2021-07-08T17:23:02",
            "upload_time_iso_8601": "2021-07-08T17:23:02.518555Z",
            "url": "https://files.pythonhosted.org/packages/fc/71/853179e2b7f8b068c53d336ff2473fcd00f1b63333d9d71f76b4245d68ef/deltas-0.7.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2021-07-08 17:23:02",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "halfak",
    "github_project": "deltas",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "yamlconf",
            "specs": []
        }
    ],
    "lcname": "deltas"
}
        
Elapsed time: 0.05407s