From a231213276e0210a8c9309d8d6dbcdcdb37ab5e2 Mon Sep 17 00:00:00 2001 From: WorldTeacher Date: Wed, 3 Sep 2025 10:33:39 +0200 Subject: [PATCH] switch from chardet to charset-normalizer --- src/logic/csvparser.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/logic/csvparser.py b/src/logic/csvparser.py index 0fa23e6..e41f2e7 100644 --- a/src/logic/csvparser.py +++ b/src/logic/csvparser.py @@ -1,13 +1,12 @@ import csv - -import chardet +from charset_normalizer import detect def csv_to_list(path: str) -> list[str]: """ Extracts the data from a csv file and returns it as a pandas dataframe """ - encoding = chardet.detect(open(path, "rb").read())["encoding"] + encoding = detect(open(path, "rb").read())["encoding"] with open(path, newline="", encoding=encoding) as csvfile: # if decoder fails to map, assign "" reader = csv.reader(csvfile, delimiter=";", quotechar="|")