pfzy
Python port of the fzy fuzzy string matching algorithm.
Requirements
python >= 3.7
Installation
pip install pfzy
Quick Start
Full documentation: https://pfzy.readthedocs.io/
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]}]
Background
fuzzywuzzy is a famous python package for performing fuzzy matching between strings powered by 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 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 which is a python implementation of the terminal fuzzy finder. The code snippet is later used by the project 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.
Credit
LICENSE
All 3 projects mentioned in Credit are all licensed under MIT.
This project is licensed under MIT. Copyright (c) 2021 Kevin Zhuang
Metadata
Release files for pfzy 0.3.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pfzy-0.3.4.tar.gz | 8.4 kB | Without provenance | Details for pfzy-0.3.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pfzy-0.3.4-py3-none-any.whl | Python 3 | none | any | Details for pfzy-0.3.4-py3-none-any.whl |
Total release size: 16.9 kB
Release files / pfzy-0.3.4.tar.gz
| Download URL | pfzy-0.3.4.tar.gz |
|---|---|
| Size | 8.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
717ea765dd10b63618e7298b2d98efd819e0b30cd5905c9707223dceeb94b3f1
|
|
BLAKE2b-256 checksum How to use checksums |
d95a32b50c077c86bfccc7bed4881c5a2b823518f5450a30e639db5d3711952e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.12 CPython/3.9.5 Linux/4.14.252-195.483.amzn2.x86_64
|
Release files / pfzy-0.3.4-py3-none-any.whl
| Download URL | pfzy-0.3.4-py3-none-any.whl |
|---|---|
| Size | 8.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5f50d5b2b3207fa72e7ec0ef08372ef652685470974a107d0d4999fc5a903a96
|
|
BLAKE2b-256 checksum How to use checksums |
8cd78ff98376b1acc4503253b685ea09981697385ce344d4e3935c2af49e044d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.12 CPython/3.9.5 Linux/4.14.252-195.483.amzn2.x86_64
|
Security for pfzy 0.3.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.