Fingerprints

1.3.1 · active · verified Fri Apr 17

The `fingerprints` library is a utility for generating stable and deterministic hashes (fingerprints) for entities based on their identifying attributes like names, addresses, and identifiers. It's commonly used in data matching and deduplication scenarios, particularly within the 'opensanctions' ecosystem. The current version is 1.3.1, and its release cadence is irregular, typically corresponding to bug fixes or minor feature enhancements.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to import and use the `generate` function to create fingerprints for different types of entities. It highlights that the library internally normalizes inputs, leading to identical fingerprints for semantically equivalent data.

from fingerprints import generate

# Generate a fingerprint for a person
person_fp = generate(name="Angela Merkel", country="de", birth_date="1954-07-17")
print(f"Person Fingerprint: {person_fp}")

# Generate a fingerprint for an organization with an address
org_fp = generate(
    name="Global Corp Inc.",
    address="123 Main Street, Cityville, Countryland",
    country="us",
    url="http://globalcorp.com"
)
print(f"Organization Fingerprint: {org_fp}")

# Fingerprints are deterministic for identical, normalized inputs
same_person_fp = generate(name="angela merkel", country="germany", birth_date="1954-07-17")
print(f"Same Person Fingerprint: {same_person_fp}")
assert person_fp == same_person_fp

view raw JSON →