import csv from clipboard

This commit is contained in:
“christopheseux”
2023-05-05 09:46:50 +02:00
parent 38b3e7b504
commit 1ff1b37adb
4 changed files with 56 additions and 21 deletions
+9
View File
@@ -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('_', ' ')