{"id":46548,"library":"string-grouper","title":"string-grouper","description":"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.","status":"active","version":"0.7.2","language":"python","source_language":"en","source_url":"https://github.com/Bergvca/string_grouper","tags":["string-matching","deduplication","tf-idf","cosine-similarity","fuzzy-matching"],"install":[{"cmd":"pip install string-grouper","lang":"bash","label":"default"}],"dependencies":[],"imports":[{"note":"Missing underscore in package name","wrong":"from stringgrouper import StringGrouper","symbol":"StringGrouper","correct":"from string_grouper import StringGrouper"},{"note":"","wrong":null,"symbol":"group_similar_strings","correct":"from string_grouper import group_similar_strings"},{"note":"","wrong":null,"symbol":"match_strings","correct":"from string_grouper import match_strings"}],"quickstart":{"code":"from string_grouper import group_similar_strings\nimport pandas as pd\n\n# Sample data\nnames = pd.Series(['Apple Inc.', 'Apple', 'Apple Computers', 'Microsoft Corp', 'Microsoft'])\n\ngrouped = group_similar_strings(names)\nprint(grouped)","lang":"python","description":"Groups similar strings in a pandas Series using default TF-IDF and cosine similarity. Install pandas if not present."},"warnings":[{"fix":"Convert your list to a pandas Series: pd.Series(your_list)","message":"The library uses pandas internally. Input must be a pandas Series or DataFrame, not a plain list.","severity":"gotcha","affected_versions":"all"},{"fix":"Pass a lower threshold: group_similar_strings(series, min_similarity=0.7)","message":"Default similarity threshold is 0.8; you may get unexpected non-matches or too many groups.","severity":"gotcha","affected_versions":"all"},{"fix":"Use StringGrouper or group_similar_strings instead.","message":"The function 'deduplicate' is deprecated and may be removed in future releases.","severity":"deprecated","affected_versions":">=0.6.0"},{"fix":"Refer to the changelog and update custom callables to accept sparse matrix inputs.","message":"In version 0.6.0, the internal API changed; custom similarity functions may need updating.","severity":"breaking","affected_versions":"0.6.0"}],"env_vars":null,"search_vec":"'0.7.2':43 '3.10':46 '4.0':47 'cadenc':49 'cosin':20,60 'cosine-similar':59 'current':41 'dedupl':26,55 'function':24 'fuzzi':31,63 'fuzzy-match':62 'group':12 'grouper':3,6 'idf':18,58 'irregular':51 'leverag':34 'librari':10 'link':28 'match':33,54,64 'matrix':37 'provid':23 'python':9,45 'record':29 'releas':48 'represent':38 'requir':44 'scalabl':40 'similar':13,21,61 'spars':36 'string':2,5,14,32,53 'string-group':1,4 'string-match':52 'tf':17,57 'tf-idf':16,56 'use':15 'version':42","created_at":"2026-06-07T13:00:27.631845+00:00","updated_at":"2026-06-07T13:00:27.631845+00:00","problems":[{"fix":"Upgrade to latest: pip install -U string-grouper","cause":"Incorrect import path or wrong package version; StringGrouper class was added in version 0.5.0.","error":"ImportError: cannot import name 'StringGrouper' from 'string_grouper'"},{"fix":"Wrap your list: pd.Series(your_list)","cause":"Input must be a pandas object.","error":"TypeError: expected Series or DataFrame, got list"},{"fix":"Check that your data contains at least one string.","cause":"Empty series passed to the function.","error":"ValueError: The number of elements in the string series must be at least 1"},{"fix":"Use sg = StringGrouper(series); groups = sg.get_groups()","cause":"The API uses 'fit_transform' or 'get_groups' instead of 'fit'.","error":"AttributeError: 'StringGrouper' object has no attribute 'fit'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops","database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}