A Python package to calculate the Levenstein distance algorithm implementation with non-GPL license, typing and speedups. The implementation is based on code samples from Levenstein Wiki.
pip install levdist
from levdist import levenshtein
distance = levenstein("dog", "cat")
- Install PDM using this documentation
- Install development dependencies
pdm install
- Install
pre-commit
hookspre-commit install
This project is using pytest
for unit testing.
To run the test you need to run pdm test
In addition to that you can lint your code using pdm lint
and check the typing by pdm mypy
.
mypy
is configured to run in strict mode for files in src
folder. Typing is not checked in tests
folder.
Each PR run GitHub actions for all actual Python versions to check if native extension is built and tests pass. Also formatting and typing will be checked.
The coverage is published to CodeCov.
To update dependencies and pre-commit
hooks there is a GHA job that is scheduled to run weekly.
To create a release, create a tag v<MAJOR>.<MINOR>.<PATCH>
. The release will be created with the source code and wheels.
The benchmark of this package can be run using pdm benchmark
command. It compare its speed with other Python implementations.
Check the BENCHMARK.md for the latest measurements.