from csv_to_db import ImportCSV import json import hashlib #importcsv = ImportCSV("RevisionBankDB") with open("test.json") as f: data = json.load(f) print() value_to_find = "amari.lawal05@gmail.com" + "Degree Apprenticeship Prep" + "Degree Apprenticeship Prep" hashedvalue = hashlib.sha256(value_to_find.encode()).hexdigest() print(hashedvalue) def test(): found_revision_card = [] for revisioncard in data["revisioncards"]: checkhash = data["email"] + revisioncard["subject"] + revisioncard["revisioncardtitle"] checkhash = hashlib.sha256(checkhash.encode()).hexdigest() if checkhash == hashedvalue: #print(revisioncard) found_revision_card.append(revisioncard) try: revisioncarddetected = found_revision_card[0] except IndexError as iex: print({"message":"revision card was not found."})