Skip to main content

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.

Metadata

Release files for mbox 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for mbox 0.1.1
File
mbox-0.1.1-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details
mbox-0.1.1-cp312-abi3-manylinux_2_35_x86_64.whl CPython 3.12 abi3 Linux glibc 2.35+ x86-64 Details
mbox-0.1.1-cp312-abi3-macosx_15_0_x86_64.whl CPython 3.12 abi3 macOS 15.0+ x86-64 Details
mbox-0.1.1-cp312-abi3-macosx_15_0_arm64.whl CPython 3.12 abi3 macOS 15.0+ ARM64 Details

Total release size: 58.9 MB

Release files / mbox-0.1.1-cp312-abi3-win_amd64.whl

Download URL mbox-0.1.1-cp312-abi3-win_amd64.whl
Size 5.3 MB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
8df7e9d69872451bc6a67723309e5df61b3153eb1d4ad17ee705a11a6713066b
BLAKE2b-256 checksum
How to use checksums
9db421e24887a92a94eaa625bd9ae0597853e09fde217dbda559edb6535b9f47
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / mbox-0.1.1-cp312-abi3-manylinux_2_35_x86_64.whl

Download URL mbox-0.1.1-cp312-abi3-manylinux_2_35_x86_64.whl
Size 40.0 MB
Tags CPython 3.12 Linux glibc 2.35+ x86-64 abi3
SHA-256 checksum
How to use checksums
48bac2341fe37f8b235edd0d50927a822f7a537ec69e2cc800fa39042b52a59e
BLAKE2b-256 checksum
How to use checksums
c8c92ad20056fb4f71a271656c4ea52a16a71c6589c63409d0e70ac1c6d76cde
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / mbox-0.1.1-cp312-abi3-macosx_15_0_x86_64.whl

Download URL mbox-0.1.1-cp312-abi3-macosx_15_0_x86_64.whl
Size 7.0 MB
Tags CPython 3.12 abi3 macOS 15.0+ x86-64
SHA-256 checksum
How to use checksums
756d854a6c8e989b5971fa9a889ff83cfd5b05a9ee5c5a60ad9f5a083e7c8b5a
BLAKE2b-256 checksum
How to use checksums
332c5dd864ae3927a8b8c72d1ca9d8fbbde521a8335ccd1f38fc9649ea0695d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / mbox-0.1.1-cp312-abi3-macosx_15_0_arm64.whl

Download URL mbox-0.1.1-cp312-abi3-macosx_15_0_arm64.whl
Size 6.7 MB
Tags CPython 3.12 abi3 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
8a451037eda2211bd4d56c6955d19ce1c02a7785703bd41edab34fda7f7d574f
BLAKE2b-256 checksum
How to use checksums
6ad19139b39a1a899e7bbadd98dc92c113c96fcc9565f4d7b0989e581fe9794a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release history Release notifications | RSS feed

0.1.2

4 release files

This release

0.1.1 This release

4 release 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