Skip to main content

reclink

reclink

Blazing-fast fuzzy matching and record linkage library powered by Rust.

PyPI Python CI License

Features

  • 21 string similarity metrics — edit distance, token-based, subsequence, alignment, and hybrid metrics
  • 10 phonetic algorithms — Soundex, Metaphone, Double Metaphone, NYSIIS, Caverphone, Cologne, Beider-Morse, Phonex, MRA, Daitch-Mokotoff
  • Full record linkage pipeline — blocking, comparison, classification, and clustering
  • 11 blocking strategies — exact, phonetic, sorted neighborhood, q-gram, LSH, canopy, trie, numeric, date, hybrid (union/intersection)
  • 8 classifiers — threshold, weighted, bands, Fellegi-Sunter with EM estimation, logistic regression, decision tree
  • 5 clustering algorithms — connected components, hierarchical, DBSCAN, OPTICS, incremental
  • 7 index structures — BK-tree, VP-tree, N-gram index, memory-mapped N-gram, MinHash LSH, Bloom filter, inverted index
  • DataFrame integration — pandas and polars accessors, native Polars plugin
  • Parallel computation — Rayon-powered cdist and pipeline execution
  • Scoring presets & composite scorer — pre-tuned configs for name, address, and general-purpose matching
  • Extensible plugin system — register custom metrics, blockers, comparators, classifiers, and preprocessors
  • WASM bindings — run reclink in the browser

Installation

pip install reclink

Build from source

git clone https://github.com/ByteVeda/reclink.git
cd reclink
uv sync --extra dev
maturin develop --release

Quick Start

Record linkage pipeline

import pandas as pd
from reclink.pipeline import ReclinkPipeline

df = pd.DataFrame({
    "id": ["1", "2", "3"],
    "first_name": ["Jon", "John", "Jane"],
    "last_name": ["Smith", "Smyth", "Doe"],
})

pipeline = (
    ReclinkPipeline.builder()
    .preprocess("first_name", ["fold_case", "strip_punctuation"])
    .preprocess("last_name", ["fold_case"])
    .block_phonetic("last_name", algorithm="soundex")
    .compare_string("first_name", metric="jaro_winkler")
    .compare_string("last_name", metric="jaro_winkler")
    .classify_threshold(0.85)
    .build()
)

matches = pipeline.dedup(df)
print(matches)
#    left_id right_id     score            scores
# 0       1        2  0.921...  [0.832..., 1.0...]

Direct metric usage

from reclink import jaro_winkler, soundex, cdist

jaro_winkler("Jon", "John")  # 0.93...
soundex("Smith") == soundex("Smyth")  # True
cdist(["Jon", "Jane"], ["John", "Janet"], scorer="jaro_winkler")  # 2x2 numpy array

Documentation

Full documentation at docs.byteveda.org/reclink, including:

Performance

Pairwise comparison (10 string pairs, 500 iterations, microseconds per pair):

Metric reclink rapidfuzz jellyfish vs rapidfuzz vs jellyfish
levenshtein 0.55 0.18 1.28 3.0x slower 2.3x faster
jaro 0.31 0.20 0.68 1.6x slower 2.2x faster
jaro_winkler 0.31 0.20 0.68 1.5x slower 2.2x faster
damerau_levenshtein 0.93 0.24 2.41 3.9x slower 2.6x faster

Batch matching (1,000 candidates, 50 iterations, microseconds per candidate):

Operation reclink rapidfuzz thefuzz vs rapidfuzz vs thefuzz
match_batch (jaro_winkler) 0.32 0.13 1.60 2.4x slower 5.0x faster

Reproduce with python benchmarks/compare.py (requires pip install rapidfuzz jellyfish thefuzz).

Development

# Setup
uv sync --extra dev
uv run pre-commit install
maturin develop --release

# Rust
cargo test --workspace
cargo clippy -- -D warnings
cargo fmt --check

# Python
uv run pytest tests/python/ -v
uv run ruff check py_src/ tests/
uv run ruff format --check py_src/ tests/
uv run mypy py_src/reclink/

License

Apache-2.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

reclink-0.1.1.tar.gz (224.7 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

reclink-0.1.1-cp313-cp313-win_amd64.whl (1.7 MB view details)

Uploaded CPython 3.13Windows x86-64

reclink-0.1.1-cp313-cp313-musllinux_1_2_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

reclink-0.1.1-cp313-cp313-musllinux_1_2_aarch64.whl (2.2 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ ARM64

reclink-0.1.1-cp313-cp313-manylinux_2_28_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

reclink-0.1.1-cp313-cp313-manylinux_2_28_aarch64.whl (2.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

reclink-0.1.1-cp313-cp313-macosx_11_0_arm64.whl (1.8 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

reclink-0.1.1-cp313-cp313-macosx_10_12_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

reclink-0.1.1-cp312-cp312-win_amd64.whl (1.7 MB view details)

Uploaded CPython 3.12Windows x86-64

reclink-0.1.1-cp312-cp312-musllinux_1_2_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

reclink-0.1.1-cp312-cp312-musllinux_1_2_aarch64.whl (2.2 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ ARM64

reclink-0.1.1-cp312-cp312-manylinux_2_28_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

reclink-0.1.1-cp312-cp312-manylinux_2_28_aarch64.whl (2.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

reclink-0.1.1-cp312-cp312-macosx_11_0_arm64.whl (1.8 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

reclink-0.1.1-cp312-cp312-macosx_10_12_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

Release history Release notifications | RSS feed

This release

0.1.1 This release

15 files

0.1.0

15 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page