Registry / ai-ml / strsim

strsim

JSON →
library0.0.3pypypiunverified

A lightweight Python library implementing various string similarity and distance measures, including Levenshtein, Jaro-Winkler, Hamming, Cosine, and more. Current version 0.0.3. Release cadence is irregular.

pip install strsim
INSTALL
IMPORT
SIG · STRSIM
S
strsim
ai-mlpythonv0.0.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Levenshtein
from similarity import Levenshtein
from strsim import Levenshtein

Computes Levenshtein distance and similarity.

from strsim import Levenshtein lev = Levenshtein() s1 = "kitten" s2 = "sitting" print(lev.distance(s1, s2)) # 3 print(lev.similarity(s1, s2)) # 0.571...
Debug
Known issues
gotchastrsim versions <0.0.3 had different import paths and API signatures. Always use version 0.0.3 or later.
fix
Upgrade to 0.0.3: pip install --upgrade strsim
affects: <0.0.3
gotchaThe library does not specify a Python version requirement (requires_python is empty). May not work on Python 2 or very old Python 3.
fix
Use Python 3.6+.
affects: all
Upgrade
Version history
0.0.3latest on PyPI · released Jul 13, 2018
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
10
OpenAI (training)
1
Resources
strsim — pip install strsim · libregistry