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.8.tar.gz (524.7 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.8-cp313-cp313-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.13Windows x86-64

kanoniv-0.3.8-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

kanoniv-0.3.8-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (4.0 MB view details)

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

kanoniv-0.3.8-cp312-cp312-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.12Windows x86-64

kanoniv-0.3.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

kanoniv-0.3.8-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (4.0 MB view details)

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

kanoniv-0.3.8-cp311-cp311-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.11Windows x86-64

kanoniv-0.3.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

kanoniv-0.3.8-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (4.0 MB view details)

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

kanoniv-0.3.8-cp310-cp310-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.10Windows x86-64

kanoniv-0.3.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

kanoniv-0.3.8-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (4.0 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.8.tar.gz.

File metadata

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

File hashes

Hashes for kanoniv-0.3.8.tar.gz
Algorithm Hash digest
SHA256 964f2bc2b859cc217dff2b1f6ea2224675ab090381aff5edea6ac4661059856a
MD5 115e15dce6afb8fc1e27030eaf22e53c
BLAKE2b-256 56d1ad72d6d13aa697324e8c9158e944fb7aa5f2bc697bed7b0b6888afb9ccd8

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for kanoniv-0.3.8-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 803321840474528e0d2039f400d725e21a8d48e6324d05c736b466ad8a4865c8
MD5 fd51bcbaa6f23172a2ab35137caa3f80
BLAKE2b-256 e1e459d24aa6cc482b76bfd2a731eb111471de392cc214ba36fc61d6020f33d0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kanoniv-0.3.8-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0de2133a685777c57b110463d7d6a1389a9a9ededc582ce8642172d409ab7806
MD5 d2c3b3c1f25eee82525cfca6ae105f33
BLAKE2b-256 ace58e56aa2c25e7c790625dc563d9fd3f5ff7e5510349820db3a337d10d4dd8

See more details on using hashes here.

File details

Details for the file kanoniv-0.3.8-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.8-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 772e760a709215ddfad94edd8f44f6867a64ac6dc3a6c1fc7eaffc10dba08930
MD5 7c30cdc7a1220702176b835b54a71c89
BLAKE2b-256 135ec67b2feb99c7e59c57293b4d62b6473fbe639e0c903ae5207c35d557d469

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for kanoniv-0.3.8-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 75c18a9fd644cf415c3ddc37f26b15651fbd148d05569becca747af6ba66f149
MD5 7bd2551ff533ecdc26edce41ed90f9fc
BLAKE2b-256 5979daed5f1a3920a96a9be2597e7726b79f6ad8dfdcb95d85128ea6ae2e2ee6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kanoniv-0.3.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d719731e49e59a42482e9e0a14f0a80ac71af88b8a0d36031f727b68f353a05e
MD5 17e53a6b48d4c1e1bf79b7e3f2307726
BLAKE2b-256 f142822a698d54f61f721e44b4e6de4c9545ce435bb7bd5d8156012a70402937

See more details on using hashes here.

File details

Details for the file kanoniv-0.3.8-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.8-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 1a06e7b677defb8e635b239a9c999f40094cd8e1a34827538264e6bb363ac063
MD5 5b95e90ef9432a910fb79ce520d1263a
BLAKE2b-256 d5a4fbb2ef4a74d1a2f6a15f31c98a6bbddbb2509de3dc07780a0aa5e2e09493

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for kanoniv-0.3.8-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 addfeea53ba2f3b16b66b6e36082846b94f3dcb42723d1bb6474cff9ebea0937
MD5 2b9b112ca06d4eb6c814f684e90913db
BLAKE2b-256 e29b10d9080cbf2b0811af8820f2f2c184924cc4c5257d0f1bcc747e8d76cbec

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kanoniv-0.3.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 29cea1727abf8a3110c45efaa2c2179c41f1c8d233bed1a81f5577d25533a6c3
MD5 f806817887e91ec0345a3c99afc92a80
BLAKE2b-256 14e217c83f289765f981046dfaefb4a6edbcf0bc05a027b9a421d6c16747e074

See more details on using hashes here.

File details

Details for the file kanoniv-0.3.8-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.8-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 a6f302e810eb5463233d9f3f3eb00bd40a058b99c0dfeabe9162a8626ed29a65
MD5 c5e9753c304ed6a35aaf35350aa42ef9
BLAKE2b-256 ef985927c12f52d298da06368fe14f9bd109a341d2c4eb7159e002a4191a9cda

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for kanoniv-0.3.8-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 89b7647f5aa6547ce2d1731e6f6e8a68b4293d1a642ebb98021bc79fbc6e02e3
MD5 73256059a0c4c5eaf9e9ab4b1a07d0ff
BLAKE2b-256 1855f9009bdf61bbdaf654284e2ed6e9f4f21dca3051784b96440b1fbef10064

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kanoniv-0.3.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f92c77bf64dfec19d47f9617abbea32bdd61709ff3836515c66c1efc5be095ce
MD5 b34bcdf36fab1491d0bd995098b5db6f
BLAKE2b-256 3c45babbcb404d396725ed0789f621d1bcd969f25c98a71cb95b872807654b8f

See more details on using hashes here.

File details

Details for the file kanoniv-0.3.8-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.8-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 7e296da5ac65f5074bed68c2667c4f22b8aecfca2e057711f218c3c91707609d
MD5 ad66fd00830f9865309e9239df6eaa98
BLAKE2b-256 a79154d6fbcfb43c2037b864d3b39a1aa3e0e4462d9581c6ee5e77f411f05c99

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