Skip to main content

Identity resolution as code

Project description

kanoniv

Identity resolution as code. Define matching rules in YAML, reconcile locally in Python.

PyPI License

Installation

pip install kanoniv

Quick Start

import kanoniv

# 1. Load your spec
spec = kanoniv.Spec.from_file("kanoniv.yml")

# 2. Validate it
result = kanoniv.validate(spec)
result.raise_on_error()

# 3. Load sources
sources = [
    kanoniv.Source.from_csv("crm", "data/crm_contacts.csv", primary_key="id"),
    kanoniv.Source.from_csv("billing", "data/billing_accounts.csv", primary_key="id"),
]

# 4. Reconcile
result = kanoniv.reconcile(sources, spec)

# 5. Golden records as a DataFrame
df = result.to_pandas()
print(f"{result.cluster_count} entities, {result.merge_rate:.0%} merge rate")

Every record in the output DataFrame gets a kanoniv_id — a stable identifier that groups duplicate records across sources into a single entity.

What the Spec Covers

The YAML spec is the single source of truth for your identity resolution pipeline:

  • Sources — canonical field mappings from each system
  • Blocking — composite keys to reduce O(n²) comparisons
  • Scoring — Fellegi-Sunter probabilistic matching with EM training
  • Normalizers — email, phone, name, nickname, domain (built-in)
  • Survivorship — golden record assembly rules (source priority, most complete)
  • Governance — freshness checks, schema validation, shadow-mode deploys

See the spec reference for the full schema.

Source Adapters

# Pandas DataFrame
source = kanoniv.Source.from_pandas("crm", df, primary_key="contact_id")

# CSV file
source = kanoniv.Source.from_csv("billing", "data/billing.csv", primary_key="account_id")

# Warehouse table (requires sqlalchemy)
source = kanoniv.Source.from_warehouse(
    "erp", table="raw.erp_customers", connection_string="postgresql://..."
)

# dbt model (requires sqlalchemy)
source = kanoniv.Source.from_dbt("staging", model="stg_customers")

Validation & Planning

# Validate spec for errors
result = kanoniv.validate(spec)
if not result:
    print(result.errors)

# Preview the execution plan
plan = kanoniv.plan(spec)
print(plan.summary())

Diffing Specs

# Compare two spec versions
diff = kanoniv.diff(spec_v1, spec_v2)
print(diff.summary)

Cloud API (Optional)

For managed reconciliation, monitoring, and collaboration, install with the cloud extra:

pip install kanoniv[cloud]
client = kanoniv.Client(api_key="kn_...")

result = client.resolve(system="crm", external_id="003xxx")
entities = client.entities.search(q="john@acme.com")

See the cloud API docs for the full reference.

Links

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kanoniv-0.3.5.tar.gz (402.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

kanoniv-0.3.5-cp313-cp313-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.13Windows x86-64

kanoniv-0.3.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

kanoniv-0.3.5-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (2.5 MB view details)

Uploaded CPython 3.13macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

kanoniv-0.3.5-cp312-cp312-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.12Windows x86-64

kanoniv-0.3.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

kanoniv-0.3.5-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (2.5 MB view details)

Uploaded CPython 3.12macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

kanoniv-0.3.5-cp311-cp311-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.11Windows x86-64

kanoniv-0.3.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

kanoniv-0.3.5-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (2.5 MB view details)

Uploaded CPython 3.11macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

kanoniv-0.3.5-cp310-cp310-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.10Windows x86-64

kanoniv-0.3.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

kanoniv-0.3.5-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (2.5 MB view details)

Uploaded CPython 3.10macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

File details

Details for the file kanoniv-0.3.5.tar.gz.

File metadata

  • Download URL: kanoniv-0.3.5.tar.gz
  • Upload date:
  • Size: 402.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.12.4

File hashes

Hashes for kanoniv-0.3.5.tar.gz
Algorithm Hash digest
SHA256 e8820136191ca856ba1ac98ec42b8e94f5ea3f6fd9fa291830a90a3d743ce80f
MD5 ecd488fc3b9fb84efa16a23f5f31eb97
BLAKE2b-256 89b0593c84fae3ae68b7e3693a66f2d85f100e44247b315452f8573b3c93733f

See more details on using hashes here.

File details

Details for the file kanoniv-0.3.5-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: kanoniv-0.3.5-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.12.4

File hashes

Hashes for kanoniv-0.3.5-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 562e133904ffe9492d4c605e342cef84d4fc83d203e1b4c2a77bd80ff9b68c5e
MD5 95194b8aae81a69fd1bebb954ea53054
BLAKE2b-256 b3b37e60686df35cba34dc6beade1bc56150d968b530d68f14a278211d12cc2c

See more details on using hashes here.

File details

Details for the file kanoniv-0.3.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for kanoniv-0.3.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 97dac2103a7fdd85932c7f0e2b43e8f69bd1862c4364942fe7f5269e761124dd
MD5 a00640e0c72c08aedb7d9434c261e6a8
BLAKE2b-256 6d20ef02c4e5de6713884215073f029285e02f2e4123d5abf4b2f568d43e58bd

See more details on using hashes here.

File details

Details for the file kanoniv-0.3.5-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for kanoniv-0.3.5-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 a2a94c8fab88005d0bab1b7f4fc79607f2b10a2eca081506f144a082829d6d8c
MD5 22e9867e9d1954437366ab9ae4df25c9
BLAKE2b-256 a53f01c4a43cd2ad53b9996b0b320bed4386478b3e14d5c89904a4b45994e1a8

See more details on using hashes here.

File details

Details for the file kanoniv-0.3.5-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: kanoniv-0.3.5-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.12.4

File hashes

Hashes for kanoniv-0.3.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 340418bf86330503f12eca0e2c00be423f3399e77454a9ae338cf47dd8d54312
MD5 fab6a757c8e297764d3370fbc0d1dbc4
BLAKE2b-256 6fdd2669db836646cdb9a22109acb924443da8a89e4defd1add50e150c5d4587

See more details on using hashes here.

File details

Details for the file kanoniv-0.3.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for kanoniv-0.3.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f893bebf6dba6b06364ee7b3552c9da20efeddf8efde8b51d7a8657cac9e5671
MD5 ec7d05eabc30c3737cfb25ea53704180
BLAKE2b-256 b46e417a3f1b78f12a09bc4088fa2babb330e773046d4085075eb0dcdf2bc1c7

See more details on using hashes here.

File details

Details for the file kanoniv-0.3.5-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for kanoniv-0.3.5-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 e7afecf316497f66e492c5bca9ad758e409bff6cd7f0e437473c58c17389c2fb
MD5 36111a92cf056b87bcdbb0adb2ae6804
BLAKE2b-256 97285d19cf5934c22e8ec2554cc01815e4b47f340f4bed99218da926311145b8

See more details on using hashes here.

File details

Details for the file kanoniv-0.3.5-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: kanoniv-0.3.5-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.12.4

File hashes

Hashes for kanoniv-0.3.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 6929591aca208d836e77e41dac47b282121c3ceeed08a4fe2d71aff52ba342a6
MD5 b61e8a71eafcf160ef6520ea4c587e9d
BLAKE2b-256 6755a9ed1ffa9bab05af18249bf9928a6a703c1e61ea4a4d8a1a7994d9bdb40e

See more details on using hashes here.

File details

Details for the file kanoniv-0.3.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for kanoniv-0.3.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d8568c18a8876ca031eea00f81be041ca22b83a44f021467edb99fccc1ac8eb1
MD5 68639f7c6d7096839a712ffa9c3c65eb
BLAKE2b-256 7f61ec3248c1c76f37133fe22e97755fb185134072a0bc6dc330ed5822efbdb1

See more details on using hashes here.

File details

Details for the file kanoniv-0.3.5-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for kanoniv-0.3.5-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 b632f4be4f4d000e9a7fa078781943b3c67eca2ea1d485836e1fe6762fe4aa19
MD5 bdce88061c9057d6be341c9fb5945e17
BLAKE2b-256 3cc4e49bb28ce42a44666534762b48c2695e3eab107f9ec2c986f071be8c6bcf

See more details on using hashes here.

File details

Details for the file kanoniv-0.3.5-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: kanoniv-0.3.5-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.12.4

File hashes

Hashes for kanoniv-0.3.5-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 ca47690aab839db918641b2fa6fbabd49a35ff25fa92e3f90cd7185478932825
MD5 f39aad2af7abbe661f7330bcfe49b270
BLAKE2b-256 265975c7372926116f0e2e40bc644f690197d1737ba175e7a94687347bfd70c5

See more details on using hashes here.

File details

Details for the file kanoniv-0.3.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for kanoniv-0.3.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6b31dd7c23b06b285dbbf0d240bda08cbe82701f429613cd59a1505c6e2298d0
MD5 b403a71f1a49efa4b6e15d08b2f6d629
BLAKE2b-256 48db6dc09d54eaf90900f04c646b81632a9bb9d73cbac01c10eeb41fc7bdbf71

See more details on using hashes here.

File details

Details for the file kanoniv-0.3.5-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for kanoniv-0.3.5-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 c1a13486bf4cab53fa3c73c41f6e60b497366d2c7e428d62c924135a1ec9e61a
MD5 374d58cf7cd631af11e4ec81c2925104
BLAKE2b-256 81d2006811cb9d049abd635981d08212bb8196fb20861d4d1cf6f984a7c3b752

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page