Spaces:
Runtime error
Runtime error
File size: 878 Bytes
2c10fe2 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
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."}) |