Skip to main content

pramiti-merger-reconciler

Standalone data model reconciler for M&A integration. Matches, classifies, and suggests resolutions for conflicting business concepts across two workspaces. Zero dependencies -- inject an optional LLM adapter for semantic matching.

Install

pip install pramiti-merger-reconciler

Quick Start

from pramiti_merger_reconciler import ClassSpec, ClassConflict, match_classes, classify, suggest

classes_a = [ClassSpec(class_name="Revenue", definition="Net revenue from paid invoices")]
classes_b = [ClassSpec(class_name="Revenue", definition="Total gross revenue")]

matches = match_classes(classes_a, classes_b)
for m in matches:
    conflict_type = classify(m)
    proposal = suggest(ClassConflict(m, conflict_type))
    print(f"{m.match_type} (score={m.score}): {conflict_type} -> {proposal}")

4-Step Matching Algorithm

  1. Exact name match (score=1.0) -- case-insensitive string comparison
  2. Normalized name match (score=0.9) -- strips suffixes (-data, -record, -table, -entity, -type, -class, -model, -info, -detail), whitespace, and underscores
  3. Semantic LLM similarity (score=0.5--0.85, threshold=0.7) -- capped at max_similarity_pairs (default: 200) to prevent O(N*M) LLM budget exhaustion. Pairs the cap drops are returned as MatchResult(match_type="skipped", skipped_by_cap=True) rather than disappearing into unmatched residuals.
  4. Unmatched residuals (score=0.0) -- classes with no match in either workspace

Conflict Classification

from pramiti_merger_reconciler import classify

conflict_type = classify(match_result)
Type Meaning
identical Exact/normalized match with same source tables
compatible High-score match, one workspace's tables are a subset of the other's
structural_conflict Same concept name, completely disjoint source tables
semantic_conflict Similar name but incompatible definitions or tables
missing Class exists only in one workspace

Resolution Suggestions

from pramiti_merger_reconciler import suggest, ClassConflict

# Without LLM -- canned responses for identical/compatible/missing
proposal = suggest(ClassConflict(match_result, "semantic_conflict"))

# With LLM -- richer proposals for semantic/structural conflicts
proposal = suggest(ClassConflict(match_result, "semantic_conflict"), llm=my_llm)

Custom LLM Adapter

Implement ILLMAdapter (structural subtyping via Protocol -- no inheritance required):

from pramiti_merger_reconciler import ILLMAdapter

class MyLLM:
    def compute_similarity(self, description_a: str, description_b: str) -> float:
        """Return semantic similarity 0.0-1.0."""
        ...

    def generate_resolution(
        self, name_a: str, name_b: str,
        definition_a: str, definition_b: str,
        tables_a: str, tables_b: str,
        conflict_type: str,
    ) -> str:
        """Return a resolution proposal string."""
        ...

matches = match_classes(classes_a, classes_b, llm=MyLLM(), max_similarity_pairs=200)

Without an LLM, NoOpLLMAdapter is used (returns 0.0 for all similarities, so step 3 produces no matches).

API

Export Description
ClassSpec Dataclass: class_name, definition, mapped_tables. Supports from_dict() and from_orm().
MatchResult Dataclass: class_a, class_b, match_type, score, skipped_by_cap.
ClassConflict Dataclass: match (MatchResult) + conflict_type.
ReportSummary Dataclass: aggregate counts and conflict details for a reconciliation run.
match_classes() Run the 4-step matching algorithm.
classify() Classify a MatchResult into a conflict type string.
suggest() Generate a resolution proposal (canned or LLM-assisted).
ILLMAdapter Protocol for LLM backends.
NoOpLLMAdapter Default no-op adapter (returns 0.0 for all similarities).
ReconcilerError Base exception for all reconciler errors.
MatchingError Raised on unrecoverable matching errors. Also subclasses RuntimeError for backward compatibility.
LLMUnavailableError Subclass of MatchingError. Raised when the injected LLM adapter fails 3 consecutive times during matching (the match aborts rather than silently scoring pairs 0.0).

License

MIT -- Pramiti Labs

Metadata

Release files for pramiti-merger-reconciler 0.1.0

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

Source distribution (sdist)

Source distribution for pramiti-merger-reconciler 0.1.0
File Size Uploaded Provenance Actions
pramiti_merger_reconciler-0.1.0.tar.gz 15.9 kB With provenance Details for pramiti_merger_reconciler-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pramiti-merger-reconciler 0.1.0
File Interpreter ABI Platform Actions
pramiti_merger_reconciler-0.1.0-py3-none-any.whl Python 3 none any Details for pramiti_merger_reconciler-0.1.0-py3-none-any.whl

Total release size: 29.2 kB

Release files / pramiti_merger_reconciler-0.1.0.tar.gz

Download URL pramiti_merger_reconciler-0.1.0.tar.gz
Size 15.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ce23a9b41a09edb33ea13927528cb090a28a331af928568e14c51ba2888856a1
BLAKE2b-256 checksum
How to use checksums
220353a2254996d00e162b276acc75dcbd4c8910a6e6bd5cf41b084857b7aac8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

Release files / pramiti_merger_reconciler-0.1.0-py3-none-any.whl

Download URL pramiti_merger_reconciler-0.1.0-py3-none-any.whl
Size 13.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cbb268e873c962c4f0c701c0c82b613cec427edaf3f814e779615ae2c37203c9
BLAKE2b-256 checksum
How to use checksums
6a001dfe6412aeac588a9d15ac94c4004843bfa794098bbd0b07664d16eae20c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

Security for pramiti-merger-reconciler 0.1.0

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pramiti_merger_reconciler-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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