pylev3
A Python3 Levenshtein distance (re)implementation of pylev.
Calculation of Levenshtein distance between strings. Based on the Wikipedia code samples.
Requirements
Python Python 3.3+ or PyPy3
Installation
pip install pylev3
Usage
Usage is fairly straightforward:
from pylev3 import Levenshtein
assert Levenshtein.classic('', 'cat'), 3
assert Levenshtein.damerau('cat', 'cat'), 0
assert Levenshtein.wf('kitten', 'sitting'), 3
assert Levenshtein.wfi(['cat', 'kitten'], 'abc'), [3, 6]
assert Levenshtein()(['cat', 'kitten'], ['cat', 'abc']), [[0, 3], [5, 6]]
Or use old way (like in pylev):
from pylev3 import wf_levenshtein, wfi_levenshtein, damerau_levenshtein, classic_levenshtein
assert classic_levenshtein('', 'cat'), 3
assert damerau_levenshtein('cat', 'cat'), 0
assert wf_levenshtein('kitten', 'sitting'), 3
assert wfi_levenshtein(['cat', 'kitten'], 'abc'), [3, 6]
assert wf_levenshtein(['cat', 'kitten'], ['cat', 'abc']), [[0, 3], [5, 6]]
License
New BSD (as authored).
Tests
# get
$ git clone https://github.com/hell03end/pylev3.git
$ cd pylev3
# run
$ python -m unittest tests
Metadata
Release files for pylev3 1.1.0
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 |
|---|---|---|---|---|
| pylev3-1.1.0.tar.gz | 4.7 kB | Without provenance | Details for pylev3-1.1.0.tar.gz |
Release files / pylev3-1.1.0.tar.gz
| Download URL | pylev3-1.1.0.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
286d24c9081c67586a69d2b298b1349a6e0d063b0e32a8d370bcb8683b1f996f
|
|
BLAKE2b-256 checksum How to use checksums |
d181eef308014494cb2758ea4993794e088d02416259af843365932d9aa95bdd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for pylev3 1.1.0
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.