A local-first library for building, running and evaluating entity resolution pipelines.
Record matching is a chore. matchlab makes it a pipeline you can build, run, query and measure — on your machine, against your warehouse, with nothing to deploy.
import matchlab as mb
companies = mb.read_database(
name="crn",
sql="select pk, company, town from companies",
client=warehouse,
key_field="pk",
)
entities = (
companies.clean({"name": "lower(crn_company)"})
.dedupe(
model_class=mb.NaiveDeduper,
model_settings={"unique_fields": ["name"]},
)
.resolve()
.collect()
)
entities.lookup_key(from_source="crn", to_sources=["dh"], key="a1")Read the full documentation.
- A lazy plan.
Source(...).dedupe(...).resolve()builds a tree of steps. Nothing runs until youcollect(). - Content-addressed caching. Re-collecting an unchanged plan does no work. Adding a step runs only that step.
- Materialised resolver output. A collected resolver writes a complete
(root, leaf, key, source)table, so lookups are reads, not re-derivations. - Measurement as a first-class job. Sample clusters, record judgements, score precision and recall, and compare methodologies on equal terms.
No server, no accounts, no permissions, nothing to deploy. If you need a shared, governed matching service, matchlab is not that.
pip install matchlabmatchlab is the successor to matchbox-db, with the server removed and the client API rebuilt. It's a hard break — see the migration guide.
See our full development guide and coding standards on our contribution guide.