The reference documents the public surface of strsimpy 0.5.0. The library is
a Rust extension with a thin Python packaging layer; class names, constructor
options and historical module paths are preserved from the pure-Python
releases.
API reference
Every public class, its module, constructor defaults, methods, return types, ABC registrations and pickle support.
Changelog
What changed in 0.5.0, plus links to the complete release history on GitHub.
Version and platform
- Package version:
strsimpy0.5.0. Read it at runtime asstrsimpy.__version__. - Python: 3.10 and newer. Prebuilt abi3 wheels cover Linux (manylinux and musllinux, x86_64 and aarch64), macOS (x86_64 and arm64) and Windows x64.
- Building from source requires Rust 1.85 or newer and
maturin.
Import paths
Every public class and the shingle_profile helper can be imported from the
package root:
from strsimpy import Jaccard, Levenshtein, NormalizedCompressionDistance
from strsimpy.levenshtein import Levenshtein as SameLevenshteinThe per-module imports return the same objects as the package-root exports. The
base classes live in strsimpy.string_distance, strsimpy.string_similarity
and strsimpy.shingle_based.
Families
| Family | Public classes |
|---|---|
| Edit and sequence | Levenshtein, NormalizedLevenshtein, WeightedLevenshtein, Damerau, OptimalStringAlignment, JaroWinkler, StrCmp95, MLIPNS, LongestCommonSubsequence, MetricLCS, RatcliffObershelp, NGram |
| Shingle and set | QGram, Cosine, Jaccard, SorensenDice, OverlapCoefficient, Tversky, Tanimoto |
| Token | Bag, MongeElkan |
| Sequence alignment | NeedlemanWunsch, SmithWaterman, Gotoh |
| Compression | NormalizedCompressionDistance |
| Experimental | SIFT4, SIFT4Options |
| Base classes and helper | StringDistance, NormalizedStringDistance, MetricStringDistance, StringSimilarity, NormalizedStringSimilarity, ShingleBased, shingle_profile |
The API reference groups these classes with their exact constructors, methods, return types and registrations.