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.4.tar.gz (401.3 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.4-cp313-cp313-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.13Windows x86-64

kanoniv-0.3.4-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.4-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.4-cp312-cp312-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.12Windows x86-64

kanoniv-0.3.4-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.4-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.4-cp311-cp311-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.11Windows x86-64

kanoniv-0.3.4-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.4-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.4-cp310-cp310-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.10Windows x86-64

kanoniv-0.3.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

kanoniv-0.3.4-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.4.tar.gz.

File metadata

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

File hashes

Hashes for kanoniv-0.3.4.tar.gz
Algorithm Hash digest
SHA256 6dddaa69dcf89d3c04b1b4b002060fc0bd097153f30a2b8da81f1bbbf8732e67
MD5 a6137993d01079168ac8977117d8253e
BLAKE2b-256 62ad49d06c29c4da773f2b1327625fe6ee6b7020ab41b287dfb223a5477fe44e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kanoniv-0.3.4-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.4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 4129ae7c36667179f63c1408e8c9c138bf21cee61cdeadd2f492ac8d88936eae
MD5 ec3af86f04205dfb751e3ebe7c5e6029
BLAKE2b-256 13c088722206e375f6f8c4400d8ada08be8870209d4944a5164757c666b104b4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kanoniv-0.3.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e4322b45d9fcb4804bf2dd0e090167fdfc0ce9ae96d5f4df1a961e633d1fa810
MD5 93fb957779d0eb24f5e2dae03858a8fa
BLAKE2b-256 db2524a8db42adbdcfd1f3c2f192622afe89487284e00c710d1d45883ddf3dcf

See more details on using hashes here.

File details

Details for the file kanoniv-0.3.4-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.4-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 a1582d68584ba1df1c8aa75af1f74e36c3aaa3e033443ff07c999b057f5d087d
MD5 36e9c68f6f923624510ea9f75f9c6e20
BLAKE2b-256 de0457987132bc48eb2fe0be6f6b081f569b56e0b3145fd8e9b7b703cb1ab714

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kanoniv-0.3.4-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.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a2a8eb3d7e9f4c7b3af06a4a0290e8665624a687258146937f78892d0b6ce231
MD5 0bcddedec6453a601dd5f61b23a295ad
BLAKE2b-256 9ebadf6805fdce9b32a4ac7d23086793ca029b0405d94ba581557203f1ebb768

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kanoniv-0.3.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f30281a366ddcc8920c9747eac2f65ca84c1b7ceb60474abd98f3a183c29e317
MD5 4b3f9ca9ee9d5b8da2d4dbe4d86fe57d
BLAKE2b-256 a9ed97daf1755d7ac9fe6652bae4556539859260bf1c0736e218406a3fdf950a

See more details on using hashes here.

File details

Details for the file kanoniv-0.3.4-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.4-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 babac0469683249f8d44d99b606b7b0f55e3fa31d7030bd0a471f0d05aa102ee
MD5 fe86a6107de457107e545000f9770fe8
BLAKE2b-256 2678a4e8021c93083ecf8d538e7b70a769fddcbfe44cae17e329f819630bc5ed

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kanoniv-0.3.4-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.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 6de6bc2b84a145a5a16e5483d46a3792af11f0de790633565f3810509ca551ba
MD5 7074ec97cecf0ae52186a5327cfbeb81
BLAKE2b-256 c9f35dc385918cc9b7d466e05bbea01c335747bf509034b95ac806718e415969

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kanoniv-0.3.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 73fc2ababd504b55d9ea8778aa1c83171d3926ee3837c3e8747fc491383b1d1c
MD5 6e14f98a4a571297a9d082b64d5e38ca
BLAKE2b-256 60c59a2216cb731a325a633488fc3b5324ef9d058fd9a4a789f17a42fa97354e

See more details on using hashes here.

File details

Details for the file kanoniv-0.3.4-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.4-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 241b2dd3e9fc3f4856ffbc012dbad92bef5c947aa107549ec7c3a2d6f5d51028
MD5 e00b61706733b793e0ab4638f3152a3c
BLAKE2b-256 7d39459fd7db68b71f90dcf4a1bac96bb9befec50afc6bcc83d6120100ab50de

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kanoniv-0.3.4-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.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 e64873628bd16af1acf1f82b779d0e4c36edf3854444f60d8c8421a488aafdb7
MD5 ae2070688a091df16a7f007d20dc0e76
BLAKE2b-256 faf2ca7e81b114817c75402e7ecd2b637b7a093514e0765a44368b86daa67342

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kanoniv-0.3.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 99ac0d10178618f9674eb08df8e159a47184e62bc9166cd220ab95bf45a6f7eb
MD5 bba629c47115a1a157a12a946a48f8df
BLAKE2b-256 2d328b0addcbc24b91dd83bc758ec7d6dbd5af69f79cc3b7a01849a22c90c417

See more details on using hashes here.

File details

Details for the file kanoniv-0.3.4-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.4-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 1a6065eb716850f7aea9317751fbc04f819ffc2eb052608fec488862ea8395af
MD5 492e84c3f12782c3a8c22bb8f1b99c0f
BLAKE2b-256 c25e1be114cea2dd97ea574ee3b4f9f91dfdfab94db7eff91c88356e1e484ebb

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