string-grouper
String grouper contains functions to do string matching using TF-IDF and the cossine similarity.
What it is and what it does
String Grouper is a library for finding groups of similar strings within a single list or across multiple lists. It uses TF-IDF vectorization and cosine similarity to identify matches, then groups them into clusters with a centroid representative. The library is built for speed: it leverages sp_matmul_rs, a Rust-based sparse matrix multiplication library, to compute similarities efficiently even on large datasets.
The package is typically used for data cleaning and deduplication tasks—matching company names with typos or formatting variations, finding duplicate entries in databases, or resolving indirect associations between strings through graph-based grouping. It exposes two main functions: match_strings to find pairwise matches above a similarity threshold, and group_similar_strings to cluster strings and identify canonical representatives. The core dependencies are numpy, pandas, scikit-learn, and scipy, making it a natural fit for data-science workflows.
Use it for:
- Deduplicate company or product names in datasets where exact matches fail due to formatting or spelling variations.
- Find all variations of a customer name across multiple database records for entity resolution.
- Identify similar addresses or locations in bulk data to consolidate records.
- Cluster misspelled or abbreviated terms in text datasets to group related concepts.
- Resolve indirect associations between strings in large datasets where direct pairwise comparison is infeasible.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
String Grouper finds groups of similar strings within or across lists using TF-IDF and cosine similarity, optimized for speed through sparse matrix operations.
Yes. String Grouper is actively maintained, has no known vulnerabilities, installs with low friction, and solves a concrete problem in data cleaning and deduplication. It is well-suited for anyone working with messy text data in pandas workflows. The MIT license removes licensing friction. Install it if you need fuzzy string matching or deduplication at scale.
Install
string-grouper on PyPI
pip
pip install string-grouperuv
uv add string-grouperpoetry
poetry add string-grouperInstalling string-grouper
Before you install
Low install friction with a pure Python wheel. Active maintenance as of 19 days ago. Depends on numpy, pandas, scikit-learn, scipy, and two specialized sparse-matrix libraries (sp_matmul_rs and sparse_dot_topn), all of which are standard data-science packages.
License in practice
MIT license permits commercial and private use with minimal restrictions, making it suitable for most projects without licensing concerns.
Quickstart
pip install string-grouper
from string_grouper import match_strings, group_similar_strings
import pandas as pd
names = pd.Series(['Apple Inc', 'Apple Inc.', 'Microsoft Corp'])
matches = match_strings(names)
groups = group_similar_strings(names)
Requires Python 3.10 or later (and less than 4.0).
Verify before relying
- Whether the Rust-based sp_matmul_rs backend is pre-compiled for all common platforms or requires build tools.
- Performance characteristics on datasets smaller than the 663,000-name example cited in the description.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<4.0,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 7 — loguru, numpy, pandas, scikit-learn, scipy, sp-matmul-rs, sparse-dot-topn |
| Maintenance | actively maintained — 19 days since the last release |
| First released | |
| Downloads | 115,963/month — #12,228 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: string_grouper-0.8.0-py3-none-any.whl
Tags
More Information Analysis packages
A drop-in replacement for Python's standard…
permissive · top 100 on PyPI
pyarrowpyarrow provides Python bindings to Apache…
permissive · top 100 on PyPI
networkxNetworkX provides data structures and…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
contourpyContourPy calculates contours of 2D…
permissive · top 1,000 on PyPI
snowflake-snowpark-pythonSnowpark Python provides APIs to query and…
permissive · top 1,000 on PyPI
tfidf-matcherPerforms fast fuzzy string matching on large…
permissive · top 15,000 on PyPI
strsimpyImplements a dozen string similarity and…
permissive · top 15,000 on PyPI
fuzzyset2Performs fuzzy string matching and approximate…
permissive · top 15,000 on PyPI
pysimstringProvides fast approximate string matching and…
unclear · top 15,000 on PyPI
textdistanceComputes distance and similarity between text…
permissive · top 5,000 on PyPI
ngramExtends Python's set class to perform fuzzy…
copyleft · top 15,000 on PyPI
LevenshteinLevenshtein computes string edit distances,…
copyleft · top 1,000 on PyPI
sparse-dot-topnPerforms fast sparse matrix multiplication with…
permissive · top 15,000 on PyPI
py-tlshGenerates locality-sensitive hashes for fuzzy…
permissive · top 15,000 on PyPI
pfzyProvides fuzzy string matching with match…
permissive · top 5,000 on PyPI