Example in your pypi page is wrong - various errors occur as your underlying API has changed. This works (and I added my brothers' names as example data).
#!/usr/bin/env python
import pandas as pd
from name_matching.name_matcher import NameMatcher
# initialise the name matcher
matcher = NameMatcher(
number_of_matches=3, legal_suffixes=True, common_words=False, top_n=50, verbose=True
)
# adjust the distance metrics to use
matcher.set_distance_metrics(["bag", "typo", "refined_soundex"])
# load the data to which the names should be matched
df_gleif = pd.DataFrame({"name": ["guy", "ron", "chen"]})
matcher.load_and_process_master_data("name", df_gleif, transform=True)
unknown_counterparties = pd.DataFrame({"name": ["guy", "ron", "chen"]})
# perform the name matching on the data you want matched
matches = matcher.match_names(
to_be_matched=unknown_counterparties, column_matching="name"
)
print(matches)
Example in your
pypi
page is wrong - various errors occur as your underlying API has changed. This works (and I added my brothers' names as example data).