skillfed

strsimpy

A library implementing different string similarity and distance measures

strsimpy v0.2.1 513.3K downloads/30d#6,248 on PyPI1,018
Permissive license MIT License Abandoned released

What it is and what it does

strsimpy is a Python port of a Java string-similarity library that provides implementations of multiple string comparison algorithms. It lets you measure how similar or different two strings are using different mathematical approaches—some compute edit distance (how many character changes are needed), others use n-gram profiles or set-based metrics. Each algorithm has different trade-offs: some are normalized to 0–1 ranges, some satisfy the triangle inequality property useful for indexing, and some are optimized for specific tasks like typo correction or diff utilities.

You import an algorithm class, instantiate it, and call its similarity() or distance() method on two strings. The library includes Levenshtein variants (standard, normalized, weighted, Damerau), Jaro-Winkler, Longest Common Subsequence, n-gram based methods (Q-Gram, cosine, Jaccard, Sorensen-Dice, overlap), and experimental SIFT4. It has no external dependencies and installs as a pure Python wheel.

Use it for:

  • Detect typos and suggest corrections by finding the most similar string from a dictionary using Jaro-Winkler
  • Implement a fuzzy search feature that matches user input against product names or database records despite spelling variations
  • Compare file contents or code diffs by computing Longest Common Subsequence distance
  • Build a deduplication system that identifies near-duplicate records in a dataset using normalized Levenshtein
  • Analyze OCR output by using weighted Levenshtein to account for character-specific error costs

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Implements a dozen string similarity and distance algorithms including Levenshtein, Jaro-Winkler, Longest Common Subsequence, and cosine similarity for comparing text strings.

Yes, if you need string similarity algorithms and can accept an abandoned package. The library is stable, has no known vulnerabilities, low install friction, and covers a comprehensive range of algorithms. However, do not install if you require active maintenance, bug fixes, or support for Python versions beyond 3.9—the last release was 2021-09-10 with no commits since November 2022.

Install

strsimpy on PyPI

pip

pip install strsimpy

uv

uv add strsimpy

poetry

poetry add strsimpy

Installing strsimpy

Before you install

Low install friction with no runtime dependencies. However, the package is abandoned—last release was 2021-09-10 and last commit 2022-11-12—so no active maintenance or bug fixes should be expected.

License in practice

MIT License permits commercial and private use with minimal restrictions, requiring only license and copyright notice retention.

Quickstart

pip install strsimpy

from strsimpy.jaro_winkler import JaroWinkler
jw = JaroWinkler()
similarity = jw.similarity('string1', 'string2')

Verify before relying

  • Whether the package works reliably with Python versions beyond 3.9 despite classifiers only listing up to 3.9
  • Performance characteristics on very long strings or large-scale batch comparisons
  • Whether all dozen algorithms mentioned in the description are fully implemented and documented

Package facts

License MIT License (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance abandoned — 1,799 days since the last release
Last repo commit
First released
Downloads 513,251/month — #6,248 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: strsimpy-0.2.1-py3-none-any.whl

License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

string similarity distancelevenshtein distancejaro-winkler similaritytext comparison algorithmsstring matchingedit distancefuzzy string matching
string-algorithmstext-analysis

More Text Processing packages