pfzy


Namepfzy JSON
Version 0.3.4 PyPI version JSON
download
home_pagehttps://github.com/kazhala/pfzy
SummaryPython port of the fzy fuzzy string matching algorithm
upload_time2022-01-28 02:26:17
maintainer
docs_urlNone
authorKevin Zhuang
requires_python>=3.7,<4.0
licenseMIT
keywords fuzzy string fzy search development
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pfzy

[![CI](https://github.com/kazhala/pfzy/workflows/CI/badge.svg)](https://github.com/kazhala/pfzy/actions?query=workflow%3ACI)
[![Docs](https://img.shields.io/readthedocs/pfzy?label=Docs&logo=Read%20the%20Docs)](https://readthedocs.org/projects/pfzy/)
[![Build](https://codebuild.ap-southeast-2.amazonaws.com/badges?uuid=eyJlbmNyeXB0ZWREYXRhIjoiT2pwUFo2MVBzV1ptL0d4VDhmSHo4bSswVHFuaEh6bEU1d2g3bmpsdnZjSzcwWkxac3NHcjBKZDkyT2t1R0VveHJ0WlNFWmZmUjNQUGFpemxwV2loRm9rPSIsIml2UGFyYW1ldGVyU3BlYyI6Imw4dlcwYjlxaU9kYVd0UkoiLCJtYXRlcmlhbFNldFNlcmlhbCI6MX0%3D&branch=master)](https://ap-southeast-2.console.aws.amazon.com/codesuite/codebuild/378756445655/projects/pfzy/history?region=ap-southeast-2&builds-meta=eyJmIjp7InRleHQiOiIifSwicyI6e30sIm4iOjIwLCJpIjowfQ)
[![Coverage](https://img.shields.io/coveralls/github/kazhala/pfzy?logo=coveralls)](https://coveralls.io/github/kazhala/pfzy?branch=master)
[![Version](https://img.shields.io/pypi/pyversions/pfzy)](https://pypi.org/project/pfzy/)
[![PyPi](https://img.shields.io/pypi/v/pfzy)](https://pypi.org/project/pfzy/)
[![License](https://img.shields.io/pypi/l/pfzy)](https://github.com/kazhala/pfzy/blob/master/LICENSE)

<!-- start elevator-pitch-intro -->

Python port of the [fzy](https://github.com/jhawthorn/fzy) fuzzy string matching algorithm.

- [Async fuzzy match function](https://pfzy.readthedocs.io/en/latest/pages/usage.html#matcher)
- [Fzy scorer (fuzzy string match)](https://pfzy.readthedocs.io/en/latest/pages/usage.html#fzy-scorer)
- [Substring scorer (exact substring match)](https://pfzy.readthedocs.io/en/latest/pages/usage.html#substr-scorer)

## Requirements

```
python >= 3.7
```

## Installation

```sh
pip install pfzy
```

## Quick Start

**Full documentation: [https://pfzy.readthedocs.io/](https://pfzy.readthedocs.io/)**

```python
import asyncio

from pfzy import fuzzy_match

result = asyncio.run(fuzzy_match("ab", ["acb", "acbabc"]))
```

```
>>> print(result)
[{'value': 'acbabc', 'indices': [3, 4]}, {'value': 'acb', 'indices': [0, 2]}]
```

<!-- end elevator-pitch-intro -->

## Background

[fuzzywuzzy](https://github.com/seatgeek/fuzzywuzzy) is a famous python package for performing fuzzy matching
between strings powered by [python-Levenshtein](https://github.com/miohtama/python-Levenshtein). While it does its
job well it doesn't calculate/provide the matching indices which is essential in a fuzzy finder applications.

The [fzy](https://github.com/jhawthorn/fzy) fuzzy matching algorithm can calculate the matching score while also
providing the matching indices which fuzzy finder applications can use to provide extra highlights.

The initial implementation of this algorithm can be found at [sweep.py](https://github.com/aslpavel/sweep.py) which
is a python implementation of the terminal fuzzy finder. The code snippet is later used by the project [vim-clap](https://github.com/liuchengxu/vim-clap).

**I found myself needing this logic across multiple projects hence decided to strip out the logic and publish a dedicated
package with detailed documentation and unittest.**

<!-- start elevator-pitch-ending -->

## Credit

- [fzy](https://github.com/jhawthorn/fzy)
- [sweep.py](https://github.com/aslpavel/sweep.py)
- [vim-clap](https://github.com/liuchengxu/vim-clap)

## LICENSE

> All 3 projects mentioned in [Credit](#credit) are all licensed under [MIT](https://opensource.org/licenses/MIT).

This project is licensed under [MIT](https://github.com/kazhala/pfzy). Copyright (c) 2021 Kevin Zhuang

<!-- end elevator-pitch-ending -->

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/kazhala/pfzy",
    "name": "pfzy",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7,<4.0",
    "maintainer_email": "",
    "keywords": "fuzzy,string,fzy,search,development",
    "author": "Kevin Zhuang",
    "author_email": "kevin7441@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/d9/5a/32b50c077c86bfccc7bed4881c5a2b823518f5450a30e639db5d3711952e/pfzy-0.3.4.tar.gz",
    "platform": "",
    "description": "# pfzy\n\n[![CI](https://github.com/kazhala/pfzy/workflows/CI/badge.svg)](https://github.com/kazhala/pfzy/actions?query=workflow%3ACI)\n[![Docs](https://img.shields.io/readthedocs/pfzy?label=Docs&logo=Read%20the%20Docs)](https://readthedocs.org/projects/pfzy/)\n[![Build](https://codebuild.ap-southeast-2.amazonaws.com/badges?uuid=eyJlbmNyeXB0ZWREYXRhIjoiT2pwUFo2MVBzV1ptL0d4VDhmSHo4bSswVHFuaEh6bEU1d2g3bmpsdnZjSzcwWkxac3NHcjBKZDkyT2t1R0VveHJ0WlNFWmZmUjNQUGFpemxwV2loRm9rPSIsIml2UGFyYW1ldGVyU3BlYyI6Imw4dlcwYjlxaU9kYVd0UkoiLCJtYXRlcmlhbFNldFNlcmlhbCI6MX0%3D&branch=master)](https://ap-southeast-2.console.aws.amazon.com/codesuite/codebuild/378756445655/projects/pfzy/history?region=ap-southeast-2&builds-meta=eyJmIjp7InRleHQiOiIifSwicyI6e30sIm4iOjIwLCJpIjowfQ)\n[![Coverage](https://img.shields.io/coveralls/github/kazhala/pfzy?logo=coveralls)](https://coveralls.io/github/kazhala/pfzy?branch=master)\n[![Version](https://img.shields.io/pypi/pyversions/pfzy)](https://pypi.org/project/pfzy/)\n[![PyPi](https://img.shields.io/pypi/v/pfzy)](https://pypi.org/project/pfzy/)\n[![License](https://img.shields.io/pypi/l/pfzy)](https://github.com/kazhala/pfzy/blob/master/LICENSE)\n\n<!-- start elevator-pitch-intro -->\n\nPython port of the [fzy](https://github.com/jhawthorn/fzy) fuzzy string matching algorithm.\n\n- [Async fuzzy match function](https://pfzy.readthedocs.io/en/latest/pages/usage.html#matcher)\n- [Fzy scorer (fuzzy string match)](https://pfzy.readthedocs.io/en/latest/pages/usage.html#fzy-scorer)\n- [Substring scorer (exact substring match)](https://pfzy.readthedocs.io/en/latest/pages/usage.html#substr-scorer)\n\n## Requirements\n\n```\npython >= 3.7\n```\n\n## Installation\n\n```sh\npip install pfzy\n```\n\n## Quick Start\n\n**Full documentation: [https://pfzy.readthedocs.io/](https://pfzy.readthedocs.io/)**\n\n```python\nimport asyncio\n\nfrom pfzy import fuzzy_match\n\nresult = asyncio.run(fuzzy_match(\"ab\", [\"acb\", \"acbabc\"]))\n```\n\n```\n>>> print(result)\n[{'value': 'acbabc', 'indices': [3, 4]}, {'value': 'acb', 'indices': [0, 2]}]\n```\n\n<!-- end elevator-pitch-intro -->\n\n## Background\n\n[fuzzywuzzy](https://github.com/seatgeek/fuzzywuzzy) is a famous python package for performing fuzzy matching\nbetween strings powered by [python-Levenshtein](https://github.com/miohtama/python-Levenshtein). While it does its\njob well it doesn't calculate/provide the matching indices which is essential in a fuzzy finder applications.\n\nThe [fzy](https://github.com/jhawthorn/fzy) fuzzy matching algorithm can calculate the matching score while also\nproviding the matching indices which fuzzy finder applications can use to provide extra highlights.\n\nThe initial implementation of this algorithm can be found at [sweep.py](https://github.com/aslpavel/sweep.py) which\nis a python implementation of the terminal fuzzy finder. The code snippet is later used by the project [vim-clap](https://github.com/liuchengxu/vim-clap).\n\n**I found myself needing this logic across multiple projects hence decided to strip out the logic and publish a dedicated\npackage with detailed documentation and unittest.**\n\n<!-- start elevator-pitch-ending -->\n\n## Credit\n\n- [fzy](https://github.com/jhawthorn/fzy)\n- [sweep.py](https://github.com/aslpavel/sweep.py)\n- [vim-clap](https://github.com/liuchengxu/vim-clap)\n\n## LICENSE\n\n> All 3 projects mentioned in [Credit](#credit) are all licensed under [MIT](https://opensource.org/licenses/MIT).\n\nThis project is licensed under [MIT](https://github.com/kazhala/pfzy). Copyright (c) 2021 Kevin Zhuang\n\n<!-- end elevator-pitch-ending -->\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python port of the fzy fuzzy string matching algorithm",
    "version": "0.3.4",
    "split_keywords": [
        "fuzzy",
        "string",
        "fzy",
        "search",
        "development"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "22ad21e3680e0aed3a0878120ffed9e1",
                "sha256": "5f50d5b2b3207fa72e7ec0ef08372ef652685470974a107d0d4999fc5a903a96"
            },
            "downloads": -1,
            "filename": "pfzy-0.3.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "22ad21e3680e0aed3a0878120ffed9e1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7,<4.0",
            "size": 8537,
            "upload_time": "2022-01-28T02:26:16",
            "upload_time_iso_8601": "2022-01-28T02:26:16.047362Z",
            "url": "https://files.pythonhosted.org/packages/8c/d7/8ff98376b1acc4503253b685ea09981697385ce344d4e3935c2af49e044d/pfzy-0.3.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "fe5314b42eae239bbe47c013243a2175",
                "sha256": "717ea765dd10b63618e7298b2d98efd819e0b30cd5905c9707223dceeb94b3f1"
            },
            "downloads": -1,
            "filename": "pfzy-0.3.4.tar.gz",
            "has_sig": false,
            "md5_digest": "fe5314b42eae239bbe47c013243a2175",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7,<4.0",
            "size": 8396,
            "upload_time": "2022-01-28T02:26:17",
            "upload_time_iso_8601": "2022-01-28T02:26:17.946867Z",
            "url": "https://files.pythonhosted.org/packages/d9/5a/32b50c077c86bfccc7bed4881c5a2b823518f5450a30e639db5d3711952e/pfzy-0.3.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-01-28 02:26:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "kazhala",
    "github_project": "pfzy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pfzy"
}
        
Elapsed time: 0.01566s