Fault-tolerant search and identity resolution for business-critical data
Project description
M|BOX Python SDK
Identity Resolution & Explainable Data Matching
The M|BOX Python SDK brings our high-performance, fault-tolerant matching core directly into your Python and Pandas workflows. Built for enterprise data harmonization, it provides the deterministic, explainable data foundation required for robust agentic data retrieval systems. Search, match, and resolve identities in milliseconds without relying on rigid pre-filtering.
Installation
Get started instantly by installing the SDK via pip:
pip install mbox
Quick Start: Match in 3 Lines
Transform any Pandas DataFrame into a fault-tolerant search index and start querying immediately.
from mbox import TableIndexer
# 1. Create an index from your existing DataFrame
index = TableIndexer.create_index(df, index_columns=["full_name", "city"])
# 2. Perform a fuzzy match with typos or variations
results = index.match(full_name="Bob Smit", city="Konstanz")
print(results)
Example Output:
The engine returns the best candidates along with explainable quality scores for every field.
| query_row | index_row | overall_score | full_name_candidate | full_name_score | city_candidate | city_score |
|---|---|---|---|---|---|---|
| 0 | 142 | 88 | Robert Smith | 85 | Konstanz | 100 |
| 0 | 89 | 62 | Bodo Schmidt | 65 | Konstanz | 100 |
Saving and Loading the Index
For production environments, you don't need to rebuild your index from the source DataFrame every time your application starts. You can compile your index into a highly optimized binary file, save it to disk, and load it instantly.
from mbox import TableIndex
# Save the compiled index to a zip archive
index.to_binary("./customer_index.zip")
# Later, load the index back into memory
loaded_index = TableIndex.load_binary("./customer_index.zip")
# You are immediately ready to match again
results = loaded_index.match(full_name="Bob Smit", city="Konstanz")
Data Harmonization: Mappings & Aliases
Real-world data is messy. Seamlessly inject domain knowledge into your index using CharacterMapping (to handle accents, casing, and special characters) and AliasSet (to handle synonyms and nicknames).
from mbox.mapping import CharacterMapping
from mbox.aliases import AliasSet
# Standardize text (e.g., expand umlauts, deaccentuate, map casing)
german_mapping = CharacterMapping.create_german_standard()
# Define synonyms with custom penalties
name_aliases = AliasSet(name="first_names")
name_aliases.add(word="Robert", alias="Bob", penalty=0)
name_aliases.add(word="Katharina", alias="Kathi", penalty=5)
# Build the index with your rules applied
index = TableIndexer.create_index(
df=df,
index_columns=["full_name", "city"],
character_mappings={"full_name": german_mapping},
alias_sets={"full_name": name_aliases}
)
Advanced Index Configuration
For production pipelines, you may need granular control over how data is tokenized and stored. While TableIndexer infers the best setup by default, you can explicitly define your architecture using TableConfig, TableFieldConfig, and IndexType.
from mbox.config import TableConfig, TableFieldConfig, IndexType
# Explicitly define the behavior for each field
name_field = TableFieldConfig(
column="full_name",
index_type=IndexType.PHRASE,
character_mapping=german_mapping,
aliases=name_aliases
)
age_field = TableFieldConfig(
column="age",
index_type=IndexType.INTEGER
)
metadata_field = TableFieldConfig(
column="source_system",
index_type=IndexType.NON_SEARCHABLE # Available in results, but not searched
)
# Assemble the configuration and build
advanced_config = TableConfig(fields=[name_field, age_field, metadata_field])
index = TableIndexer.create_index(df=df, config_overrides=advanced_config)
# Save your schema for reuse
advanced_config.to_json("./customer_index_schema.json")
Advanced Recall Configuration
Control exactly how the engine evaluates a match at query time. Using TableRecallConfig and TableRecallFieldConfig, you can dictate field weights, minimum quality thresholds, and the algorithmic matching mode (TableRecallMode) on a per-field basis.
Available String Modes:
APPROX: Levenshtein-based similarity (handles typos and phonetic variations).EXACT: Requires full strict equality.COMPLETE: Substring containment (input value exists within the indexed value).DETECT: Substring containment (indexed value exists within the input).
from mbox.recall import TableRecallConfig, TableRecallFieldConfig, TableRecallMode
# Define specific search behavior per field
name_recall = TableRecallFieldConfig(
input_column="search_name",
indexed_column="full_name",
minimum_quality=60, # Field must score at least 60
weight=80, # High impact on the overall_score
mode=TableRecallMode.APPROX
)
city_recall = TableRecallFieldConfig(
input_column="search_city",
indexed_column="city",
minimum_quality=100,
weight=20,
mode=TableRecallMode.EXACT # Must be a perfect match
)
# Assemble the recall settings
recall_settings = TableRecallConfig(
fields=[name_recall, city_recall],
max_results=5,
min_total_match_value=75,
max_quality_spread=20, # Don't return results with quality > 20 below the best match
add_single_qualities=True, # Explainability: show score per column
add_input_row=True
)
# Execute the finely-tuned search
results = index.match(
queries=query_df,
config=recall_settings
)
M|BOX is currently in beta status. We are iterating on adding more capabilities to the Python SDK.
Breaking changes may occur in minor releases until version 1.0.0.
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 mbox-0.1.0-cp312-abi3-win_amd64.whl.
File metadata
- Download URL: mbox-0.1.0-cp312-abi3-win_amd64.whl
- Upload date:
- Size: 5.3 MB
- Tags: CPython 3.12+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eadd2aec27a4f6c34a660bc41f73b2f6434d800382cc3821fc28b5bb0720d810
|
|
| MD5 |
6a6225e96a864b8e0ecc1f849fa1f441
|
|
| BLAKE2b-256 |
f5c99d8d44ee39431bde6514f8fc6f98f8242d9f44067f1cc9cb22eab8b9065b
|
File details
Details for the file mbox-0.1.0-cp312-abi3-manylinux_2_35_x86_64.whl.
File metadata
- Download URL: mbox-0.1.0-cp312-abi3-manylinux_2_35_x86_64.whl
- Upload date:
- Size: 40.0 MB
- Tags: CPython 3.12+, manylinux: glibc 2.35+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aba8ddb6bf4ed07313bfdbc17da1544dbae23be525248ebbccabcd43a811e9c7
|
|
| MD5 |
8519aafe17e2089e3864073bdc420d2c
|
|
| BLAKE2b-256 |
b696f78bb399a70d5491ee1394be89eb667458b33c9d65373d52b7c070efca3b
|
File details
Details for the file mbox-0.1.0-cp312-abi3-macosx_15_0_x86_64.whl.
File metadata
- Download URL: mbox-0.1.0-cp312-abi3-macosx_15_0_x86_64.whl
- Upload date:
- Size: 7.0 MB
- Tags: CPython 3.12+, macOS 15.0+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e5b1b5d599529b33597b8c932c27b0efd19679aca54e48eb291b3fdf1f05ade
|
|
| MD5 |
7938364013b29c4e3600720916d70c99
|
|
| BLAKE2b-256 |
84258d3d2aaa6ec8465d41cde0ef516e190b4772fbff900451f1d487de9ed90b
|
File details
Details for the file mbox-0.1.0-cp312-abi3-macosx_15_0_arm64.whl.
File metadata
- Download URL: mbox-0.1.0-cp312-abi3-macosx_15_0_arm64.whl
- Upload date:
- Size: 6.7 MB
- Tags: CPython 3.12+, macOS 15.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23a00a6eee1a970e2f6ba6b2e96f04e3f44f737a813868553cc5dbbdb2f60094
|
|
| MD5 |
5af219f4727306a8721e22edd10d7040
|
|
| BLAKE2b-256 |
9dcef3008942fe1bd122f39f73f14769fde05e96a06a4c1a63c945e20a96403e
|