Skip to main content

mightydatainc-semantic-match

This package is a "same thing, different words" detector for list names.

Imagine you process invoice data from multiple contractors.

  • One file says: "Invoice Number"
  • Another says: "Invoice ID"
  • One source says: "Vendor"
  • Another says: "Supplier"

A normal string match says those are different. This package helps you recognize they likely mean the same concept.

It helps answer a common normalization question:

"Do these two labels refer to the same thing, even if they are worded differently?"

Use it for lists of names, such as:

  • column names
  • metric names
  • category names
  • status names

Think of it this way:

  • Exact text match asks: "Are these letters identical?"
  • This package asks: "Do these labels mean the same thing?"

That makes it easier to distinguish genuinely new/removed fields from things that are simply labeled differently by different sources.

Purpose and intent

Use this package when you need to compare two versions of a list and understand what changed in human terms:

  • unchanged (same meaning)
  • renamed (same concept, different label)
  • removed
  • added

It is especially useful when reconciling client, vendor, and user-provided data that use inconsistent naming for the same concepts.

Find one matching item in a list: find_semantic_match

Use find_semantic_match when you have one item and want to know whether it already exists in a canonical list.

from openai import OpenAI
from mightydatainc_semantic_match import find_semantic_match

client = OpenAI()
items = ["Invoice Number", "Vendor", "Purchase Date"]

# "Invoice ID" likely means the same thing as "Invoice Number"
index = find_semantic_match(client, items, "Invoice ID")
print(index)  # 0

# No close semantic equivalent in the list
index = find_semantic_match(client, items, "Tax Registration ID")
print(index)  # -1

Why this is useful:

  • lets you map incoming labels to canonical names
  • avoids duplicate concepts caused by wording differences
  • returns -1 when no strong match is found

Compare two lists for unchanged/removed/added/renamed: compare_item_lists

Use compare_item_lists when you want a source-to-source diff with semantic awareness.

from openai import OpenAI
from mightydatainc_semantic_match import compare_item_lists

client = OpenAI()

before = ["Invoice Number", "Vendor", "Purchase Date", "Subtotal"]
after = ["Invoice ID", "Supplier", "Date", "Pre-Tax Total"]

results = compare_item_lists(client, before, after)
for row in results:
    print(row["classification"], row["item"], row.get("new_name"))

Why this is useful:

  • you get a practical change log, not just string-level differences
  • renamed vs removed+added is handled more intelligently
  • output is straightforward to feed into normalization or reporting logic

Optional details: use name and description instead of just strings

Plain strings work well when names are clear.

Use objects with name + optional description when names are ambiguous or overloaded. The description gives the matcher extra context so it can choose the right meaning.

Example:

from openai import OpenAI
from mightydatainc_semantic_match import find_semantic_match

client = OpenAI()

items = [
    {
        "name": "Georgia",
        "description": "Country in the South Caucasus. Capital: Tbilisi.",
    },
    {
        "name": "Georgia",
        "description": "U.S. state in the Southeast. Capital: Atlanta.",
    },
]

query = {
    "name": "Georgia",
    "description": "State in the southeastern United States",
}

index = find_semantic_match(client, items, query)
print(index)  # 1

Without descriptions, both entries look identical by name alone.

Installation and usage

pip install mightydatainc-semantic-match
import mightydatainc_semantic_match

Requires Python 3.13+

Metadata

Release files for mightydatainc-semantic-match 1.3.1

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

Source distribution (sdist)

Source distribution for mightydatainc-semantic-match 1.3.1
File Size Uploaded Provenance Actions
mightydatainc_semantic_match-1.3.1.tar.gz 16.7 kB Without provenance Details for mightydatainc_semantic_match-1.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mightydatainc-semantic-match 1.3.1
File Interpreter ABI Platform Actions
mightydatainc_semantic_match-1.3.1-py3-none-any.whl Python 3 none any Details for mightydatainc_semantic_match-1.3.1-py3-none-any.whl

Total release size: 26.7 kB

Release files / mightydatainc_semantic_match-1.3.1.tar.gz

Download URL mightydatainc_semantic_match-1.3.1.tar.gz
Size 16.7 kB
Tags Source
SHA-256 checksum
How to use checksums
0de8caf9cf9661eb05f7151ef27258a0dfe5ae58001e67fa62acac191eefbb44
BLAKE2b-256 checksum
How to use checksums
73fcfabe9e54b06e7a0edba714712af895a7088b2be5236d99e6cf9bfeac01de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / mightydatainc_semantic_match-1.3.1-py3-none-any.whl

Download URL mightydatainc_semantic_match-1.3.1-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e3f8284b2a4e31d5cee1fdffb3d8f5338960201d05376523d3213214f872e0ca
BLAKE2b-256 checksum
How to use checksums
db93219a501478e46923d5af7270e519139e4969777afcbaeb5e6a5a069602f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for mightydatainc-semantic-match 1.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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