Registry / devops / string-grouper

string-grouper

JSON →
library0.7.2pypypi✓ verified 84d ago

string-grouper is a Python library for grouping similar strings using TF-IDF and cosine similarity. It provides functions to deduplicate and link records with fuzzy string matching, leveraging a sparse matrix representation for scalability. Current version 0.7.2, requires Python >=3.10, <4.0. Release cadence is irregular.

pip install string-grouper
INSTALL
IMPORT
SIG · STRING-GROUPER
S
string-grouper
devopspythonv0.7.2
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.

StringGrouper
from string_grouper import StringGrouper
from stringgrouper import StringGrouper
Missing underscore in package name
group_similar_strings
from string_grouper import group_similar_strings
match_strings
from string_grouper import match_strings

Groups similar strings in a pandas Series using default TF-IDF and cosine similarity. Install pandas if not present.

from string_grouper import group_similar_strings import pandas as pd # Sample data names = pd.Series(['Apple Inc.', 'Apple', 'Apple Computers', 'Microsoft Corp', 'Microsoft']) grouped = group_similar_strings(names) print(grouped)
Debug
Known issues
gotchaThe library uses pandas internally. Input must be a pandas Series or DataFrame, not a plain list.
fix
Convert your list to a pandas Series: pd.Series(your_list)
affects: all
gotchaDefault similarity threshold is 0.8; you may get unexpected non-matches or too many groups.
fix
Pass a lower threshold: group_similar_strings(series, min_similarity=0.7)
affects: all
deprecatedThe function 'deduplicate' is deprecated and may be removed in future releases.
fix
Use StringGrouper or group_similar_strings instead.
affects: >=0.6.0
breakingIn version 0.6.0, the internal API changed; custom similarity functions may need updating.
fix
Refer to the changelog and update custom callables to accept sparse matrix inputs.
affects: 0.6.0
Errors
Common errors & fixes
ImportError: cannot import name 'StringGrouper' from 'string_grouper'
Incorrect import path or wrong package version; StringGrouper class was added in version 0.5.0.
fix
Upgrade to latest: pip install -U string-grouper
TypeError: expected Series or DataFrame, got list
Input must be a pandas object.
fix
Wrap your list: pd.Series(your_list)
ValueError: The number of elements in the string series must be at least 1
Empty series passed to the function.
fix
Check that your data contains at least one string.
AttributeError: 'StringGrouper' object has no attribute 'fit'
The API uses 'fit_transform' or 'get_groups' instead of 'fit'.
fix
Use sg = StringGrouper(series); groups = sg.get_groups()
Upgrade
Version history
0.7.2latest on PyPI · released Jun 3, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
20 hits · last 30 days
node
16
Meta
2
OpenAI (training)
1
Resources

No resource links recorded.

string-grouper — pip install string-grouper · libregistry