I have to match a product's category name returned from API response and product's category name from data base.
For example: api_category = "packing tape",
category names from DB = ["packing material", "packaging equipment"]
from difflib import SequenceMatcher
for e in Category.objects.all():
matching_category = SequenceMatcher(None, api_category, e.name).quick_ratio()
0.36363636363636365
0.4090909090909091
I get floats, but I want to get the most matching element (e)