{"id":21290026,"url":"https://github.com/mtingers/hashfuzz","last_synced_at":"2025-03-15T16:12:07.488Z","repository":{"id":145403308,"uuid":"168804708","full_name":"mtingers/hashfuzz","owner":"mtingers","description":"Detects similarities between strings \u0026 generates similarity hash","archived":false,"fork":false,"pushed_at":"2019-02-02T17:29:35.000Z","size":17,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-22T06:11:51.872Z","etag":null,"topics":["difflib","fuzzymatch","hash","levenshtein-distance","python","sequencematcher","string-distance"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mtingers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-02T07:01:42.000Z","updated_at":"2024-01-03T03:39:37.000Z","dependencies_parsed_at":"2023-06-03T17:15:25.616Z","dependency_job_id":null,"html_url":"https://github.com/mtingers/hashfuzz","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtingers%2Fhashfuzz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtingers%2Fhashfuzz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtingers%2Fhashfuzz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtingers%2Fhashfuzz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mtingers","download_url":"https://codeload.github.com/mtingers/hashfuzz/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243754094,"owners_count":20342542,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["difflib","fuzzymatch","hash","levenshtein-distance","python","sequencematcher","string-distance"],"created_at":"2024-11-21T12:44:27.696Z","updated_at":"2025-03-15T16:12:07.463Z","avatar_url":"https://github.com/mtingers.png","language":"Python","readme":"# hashfuzz\nHashFuzz:\n* Detect similarity between strings\n* Generate a similarity hash\n\n# Distance/likeness Ratio Examples\n```\n\u003e\u003e\u003e import hashfuzz as hf\n\u003e\u003e\u003e from difflib import SequenceMatcher\n\u003e\u003e\u003e #\n... # Compare difflib.SequenceMatcher() to hashfuzz.ratio()\n... #\n...\n\u003e\u003e\u003e a = 'apple'\n\u003e\u003e\u003e b = 'apple'\n\n\u003e\u003e\u003e 'hashfuzz=%.2f SequenceMatcher=%.2f' % (hf.ratio(a, b), SequenceMatcher(None, a, b).ratio() * 100)\n'hashfuzz=100.00 SequenceMatcher=100.00'\n\n\u003e\u003e\u003e b = 'appel'\n\u003e\u003e\u003e 'hashfuzz=%.2f SequenceMatcher=%.2f' % (hf.ratio(a, b), SequenceMatcher(None, a, b).ratio() * 100)\n'hashfuzz=99.99 SequenceMatcher=80.00'\n\n\u003e\u003e\u003e b = 'Apple'\n\u003e\u003e\u003e 'hashfuzz=%.2f SequenceMatcher=%.2f' % (hf.ratio(a, b), SequenceMatcher(None, a, b).ratio() * 100)\n'hashfuzz=80.00 SequenceMatcher=80.00'\n\n\u003e\u003e\u003e b = 'Apples'\n\u003e\u003e\u003e 'hashfuzz=%.2f SequenceMatcher=%.2f' % (hf.ratio(a, b), SequenceMatcher(None, a, b).ratio() * 100)\n'hashfuzz=72.72 SequenceMatcher=72.73'\n\n\u003e\u003e\u003e b = 'An apple'\n\u003e\u003e\u003e 'hashfuzz=%.2f SequenceMatcher=%.2f' % (hf.ratio(a, b), SequenceMatcher(None, a, b).ratio() * 100)\n'hashfuzz=57.65 SequenceMatcher=76.92'\n\n\n\u003e\u003e\u003e a = 'Hi Mr. Belvedere,\\nYour next scheduled appointment is at 3pm on Tuesday.'\n\u003e\u003e\u003e b = 'Hi Mr. Anderson,\\nYour next scheduled appointment is at 2pm on Friday.'\n\u003e\u003e\u003e 'hashfuzz=%.2f SequenceMatcher=%.2f' % (hf.ratio(a, b), SequenceMatcher(None, a, b).ratio() * 100)\n'hashfuzz=87.14 SequenceMatcher=85.71'\n\n\u003e\u003e\u003e b = 'Hello Mr. Torvalds,\\nYour next scheduled appointment is at 8:30am on Tuesday.'\n\u003e\u003e\u003e 'hashfuzz=%.2f SequenceMatcher=%.2f' % (hf.ratio(a, b), SequenceMatcher(None, a, b).ratio() * 100)\n'hashfuzz=75.13 SequenceMatcher=84.35'\n\n\u003e\u003e\u003e a = 'This text will not be like that of b'\n\u003e\u003e\u003e b = 'Not many words of a are in b, but this also matches near characters'\n\u003e\u003e\u003e 'hashfuzz=%.2f SequenceMatcher=%.2f' % (hf.ratio(a, b), SequenceMatcher(None, a, b).ratio() * 100)\n'hashfuzz=41.51 SequenceMatcher=11.65'\n\n\n\u003e\u003e\u003e a = 'Nothing similar'\n\u003e\u003e\u003e b = 'Everything different'\n\u003e\u003e\u003e 'hashfuzz=%.2f SequenceMatcher=%.2f' % (hf.ratio(a, b), SequenceMatcher(None, a, b).ratio() * 100)\n'hashfuzz=52.75 SequenceMatcher=45.71'\n\n\u003e\u003e\u003e a = 'Nothing similar'\n\u003e\u003e\u003e b = 'GREAT FUTURE'\n\u003e\u003e\u003e 'hashfuzz=%.2f SequenceMatcher=%.2f' % (hf.ratio(a, b), SequenceMatcher(None, a, b).ratio() * 100)\n'hashfuzz=10.26 SequenceMatcher=7.41'\n\n\u003e\u003e\u003e a = 'Nothing similar'\n\u003e\u003e\u003e b = 'GREATFUTURE'\n\u003e\u003e\u003e 'hashfuzz=%.2f SequenceMatcher=%.2f' % (hf.ratio(a, b), SequenceMatcher(None, a, b).ratio() * 100)\n'hashfuzz=0.00 SequenceMatcher=0.00'\n```\n\n# Hash Examples\n```python\n\u003e\u003e\u003e import hashfuzz as hf\n\u003e\u003e\u003e a = 'Guido van Rossum'\n\u003e\u003e\u003e b = 'Guido van Rossum'\n\u003e\u003e\u003e hf.ratio(a, b)\n100.0\n\u003e\u003e\u003e hf.hash(a, b)\n'b825e62e86b6ec7824bc4e8d68965136d0396c30aebd8ced9a09dfab3a5cbcee'\n\n\u003e\u003e\u003e b = 'Guido van Rossums'\n\u003e\u003e\u003e hf.ratio(a, b)\n96.96\n\u003e\u003e\u003e hf.hash(a, b)\n'b825e62e86b6ec7824bc4e8d68965136d0396c30aebd8ced9a09dfab3a5cbcee'\n\n\u003e\u003e\u003e b = 'Guido van Rossumss'\n\u003e\u003e\u003e hf.ratio(a, b)\n94.11\n\u003e\u003e\u003e hf.hash(a, b)\n'b825e62e86b6ec7824bc4e8d68965136d0396c30aebd8ced9a09dfab3a5cbcee'\n\n\u003e\u003e\u003e b = 'GGuido van Rossumss'\n\u003e\u003e\u003e hf.ratio(a, b)\n94.1633\n\u003e\u003e\u003e hf.hash(a, b)\n'b825e62e86b6ec7824bc4e8d68965136d0396c30aebd8ced9a09dfab3a5cbcee'\n\n\u003e\u003e\u003e b = 'Mr. Guido van Rossum'\n\u003e\u003e\u003e hf.ratio(a, b)\n53.36\n\u003e\u003e\u003e hf.hash(a, b)\n'6c179f21e6f62b629055d8ab40f454ed02e48b68563913473b857d3638e23b28'\n\n\u003e\u003e\u003e b = 'Mr. Guido van Rossums'\n\u003e\u003e\u003e hf.ratio(a, b)\n60.85\n\u003e\u003e\u003e hf.hash(a, b)\n'6c179f21e6f62b629055d8ab40f454ed02e48b68563913473b857d3638e23b28'\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtingers%2Fhashfuzz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmtingers%2Fhashfuzz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtingers%2Fhashfuzz/lists"}