Jaro-Winkler String Similarity

2.0.3 · active · verified Sun Apr 12

The `jaro-winkler` library provides Python implementations of the Jaro and Jaro-Winkler string similarity metrics. It allows for comparison of two strings, returning a score from 0 (no match) to 1 (perfect match). The current version is 2.0.3, offering standard and customizable versions of the functions. While not explicitly stated, the project's release cadence appears to be moderate, with major updates occurring over several years.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to import the `jaro` module and use its `jaro_winkler_metric` and `jaro_metric` functions to calculate string similarity scores. Scores range from 0 (no similarity) to 1 (identical).

import jaro

# Calculate Jaro-Winkler similarity
score_winkler = jaro.jaro_winkler_metric('SHACKLEFORD', 'SHACKELFORD')
print(f"Jaro-Winkler Similarity: {score_winkler}")

# Calculate Jaro similarity
score_jaro = jaro.jaro_metric('MARTHA', 'MARHTA')
print(f"Jaro Similarity: {score_jaro}")

view raw JSON →