Levdist
A Python package to calculate the Levenshtein distance algorithm implementation with MIT license, typing and speedups.
Install / Use
/learn @derlih/LevdistREADME
levdist
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.
Installation
pip install levdist
Usage
from levdist import levenshtein
distance = levenshtein("dog", "cat")
Development
Setup
- Install PDM using this documentation
- Install development dependencies
pdm install - Install
pre-commithookspre-commit install
Testing
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.
Type checks
mypy is configured to run in strict mode for files in src folder. Typing is not checked in tests folder.
CI
PR checks
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.
Dependency updates
To update dependencies and pre-commit hooks there is a GHA job that is scheduled to run weekly.
Release
To create a release, create a tag v<MAJOR>.<MINOR>.<PATCH>. The release will be created with the source code and wheels.
Benchmark
The benchmark of this package can be run using pdm benchmark console command. It compare its speed with other Python implementations.
Check the BENCHMARK.md for the latest measurements.
Related Skills
node-connect
344.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
99.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
344.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
344.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
