import csv from clipboard
This commit is contained in:
@@ -37,6 +37,15 @@ def import_module_from_path(path):
|
||||
print(f'Cannot import file {path}')
|
||||
print(e)
|
||||
|
||||
def fuzzy_match(s1, s2, case_sensitive=False):
|
||||
'''Tell how much two passed strings are similar 1.0 being exactly similar'''
|
||||
from difflib import SequenceMatcher
|
||||
if case_sensitive:
|
||||
similarity = SequenceMatcher(None, s1, s2)
|
||||
else:
|
||||
similarity = SequenceMatcher(None, s1.lower(), s2.lower())
|
||||
return similarity.ratio()
|
||||
|
||||
def norm_str(string, separator='_', format=str.lower, padding=0):
|
||||
string = str(string)
|
||||
string = string.replace('_', ' ')
|
||||
|
||||
Reference in New Issue
Block a user