Fast implementation of the edit distance (Levenshtein distance)
Project Links
Meta
Author: Anthony Sottile
Requires Python: >=3.6.1
Classifiers
License
- OSI Approved :: MIT License
Programming Language
- Python :: 3
- Python :: 3 :: Only
- Python :: 3.6
- Python :: 3.7
- Python :: 3.8
- Python :: 3.9
- Python :: Implementation :: CPython
- Python :: Implementation :: PyPy
editdistance-s
Fast implementation of the edit distance (Levenshtein distance).
fork
this is a fork of editdistance with the following changes:
__hash__based support is removed as it makes incorrect assumptions- only strings (type
str) are supported - cffi replaces cython (so
abi3wheels can be produced) - the module is renamed to
editdistance_s - the public api does not contain
eval(onlydistance)
installation
pip install editdistance-s
- wheels should be available on pypi in most cases
api
distance(s1: str, s2: str) -> int
compute the edit distance
>>> import editdistance_s
>>> editdistance_s.distance('hello', 'hell☃')
1
Wheel compatibility matrix
| Platform | CPython >=3.6 (abi3) | CPython >=3.8 (abi3) | PyPy 3.6 (pp73) | PyPy 3.7 (pp73) |
|---|---|---|---|---|
| macosx_10_14_x86_64 | ||||
| macosx_12_0_arm64 | ||||
| manylinux1_x86_64 | ||||
| manylinux2010_x86_64 | ||||
| win32 | ||||
| win_amd64 |
Files in release
editdistance_s-1.0.0-cp36-abi3-macosx_10_14_x86_64.whl (12.4KiB)
editdistance_s-1.0.0-cp36-abi3-manylinux1_x86_64.whl (151.6KiB)
editdistance_s-1.0.0-cp36-abi3-win32.whl (18.0KiB)
editdistance_s-1.0.0-cp36-abi3-win_amd64.whl (16.1KiB)
editdistance_s-1.0.0-cp38-abi3-macosx_12_0_arm64.whl (12.2KiB)
editdistance_s-1.0.0-pp36-pypy36_pp73-manylinux1_x86_64.whl (16.0KiB)
editdistance_s-1.0.0-pp36-pypy36_pp73-manylinux2010_x86_64.whl (16.0KiB)
editdistance_s-1.0.0-pp37-pypy37_pp73-manylinux1_x86_64.whl (16.0KiB)
editdistance_s-1.0.0-pp37-pypy37_pp73-manylinux2010_x86_64.whl (16.0KiB)
editdistance_s-1.0.0.tar.gz (5.0KiB)
Extras:
None
Dependencies:
cffi
(>=1)