No project description provided
Project description
matchr
Fast fuzzy string matching — written in Rust, usable from Python.
Install
pip install matchr
Python quick start
from matchr import best_match, rank_matches, batch_best_match
# find the closest match
best_match("oatly oat drink", ["Oatly Oat Drink 1L", "Oat Milk", "Oatly Barista"])
# → ('Oatly Oat Drink 1L', 0.902)
# filter weak matches with a threshold
best_match("xyz gibberish", ["Oatly Oat Drink 1L"], threshold=0.7)
# → None
# match many queries at once
batch_best_match(["oatly oat drink", "felix cat food"], catalog, threshold=0.7)
# → [('Oatly Oat Drink 1L', 0.902), ('Felix Cat Food 400g', 0.843)]
Rust usage
use matchr::{levenshtein, jaro_winkler, trigram_similarity};
fn main() {
println!("{}", levenshtein("cat", "bat")); // 1
println!("{}", jaro_winkler("martha", "marhta")); // 0.961
println!("{}", trigram_similarity("hello", "helo")); // 0.4
}
Algorithms
- Levenshtein — minimum edit distance between two strings. Lower = more similar.
- Jaro-Winkler — similarity score from
0.0to1.0, optimised for names and short strings. Gives a bonus for shared prefixes. - Trigram — splits strings into overlapping 3-character chunks, scores overlap using the Dice coefficient. Good for longer strings and typo detection.
- Combined score — weighted blend of all three, used internally by
best_matchandrank_matches.
Notes
- All functions normalise input (lowercase + trim) before comparing
levenshteinreturnsusize(edit distance), all others returnf64(0.0–1.0)- Python functions accept an optional
thresholdparameter — results below it are filtered out
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file matchr-0.1.1-cp38-abi3-win_amd64.whl.
File metadata
- Download URL: matchr-0.1.1-cp38-abi3-win_amd64.whl
- Upload date:
- Size: 133.8 kB
- Tags: CPython 3.8+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ec9d025c4401322679c80b756e7b899c97e037daadf61ab02bc05efd0a33106
|
|
| MD5 |
e2c55c98dbce5a7b7da60b1f2f393f6c
|
|
| BLAKE2b-256 |
ad49bf94c551853d0d42b3f80d762b3a1f83bf9816dfb8a3c368a5e9e4ca3ca4
|
Provenance
The following attestation bundles were made for matchr-0.1.1-cp38-abi3-win_amd64.whl:
Publisher:
release.yml on mommo-codes/matchr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
matchr-0.1.1-cp38-abi3-win_amd64.whl -
Subject digest:
9ec9d025c4401322679c80b756e7b899c97e037daadf61ab02bc05efd0a33106 - Sigstore transparency entry: 1733123581
- Sigstore integration time:
-
Permalink:
mommo-codes/matchr@c4a4311a0ee54dc9d8b123b58c216678ee25ad1a -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/mommo-codes
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c4a4311a0ee54dc9d8b123b58c216678ee25ad1a -
Trigger Event:
push
-
Statement type:
File details
Details for the file matchr-0.1.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: matchr-0.1.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 265.7 kB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
14c7ef97ffd3e6214be94f9503d3ec7346d22858766e93b4c8cdcaaaab204273
|
|
| MD5 |
25c6944d3af9a4fef2586956d8a3320c
|
|
| BLAKE2b-256 |
64a0afdcb0039f782e7f352e8e0eac38f7a06db0feaf44615152b076d2f59537
|
Provenance
The following attestation bundles were made for matchr-0.1.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release.yml on mommo-codes/matchr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
matchr-0.1.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
14c7ef97ffd3e6214be94f9503d3ec7346d22858766e93b4c8cdcaaaab204273 - Sigstore transparency entry: 1733123622
- Sigstore integration time:
-
Permalink:
mommo-codes/matchr@c4a4311a0ee54dc9d8b123b58c216678ee25ad1a -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/mommo-codes
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c4a4311a0ee54dc9d8b123b58c216678ee25ad1a -
Trigger Event:
push
-
Statement type:
File details
Details for the file matchr-0.1.1-cp38-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: matchr-0.1.1-cp38-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 237.6 kB
- Tags: CPython 3.8+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86ad497fb85187a1b010686e3149669f045dd011192e35767566d90875f84e67
|
|
| MD5 |
0609d632b5ab8d153fabb52e683bc6ca
|
|
| BLAKE2b-256 |
517f85c22130f0fddf55d2a08519b6972b9692acb96b094cafafd38c54aae6a4
|
Provenance
The following attestation bundles were made for matchr-0.1.1-cp38-abi3-macosx_11_0_arm64.whl:
Publisher:
release.yml on mommo-codes/matchr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
matchr-0.1.1-cp38-abi3-macosx_11_0_arm64.whl -
Subject digest:
86ad497fb85187a1b010686e3149669f045dd011192e35767566d90875f84e67 - Sigstore transparency entry: 1733123718
- Sigstore integration time:
-
Permalink:
mommo-codes/matchr@c4a4311a0ee54dc9d8b123b58c216678ee25ad1a -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/mommo-codes
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c4a4311a0ee54dc9d8b123b58c216678ee25ad1a -
Trigger Event:
push
-
Statement type: