def task_4(number): """Perform task from task 4 :param number: """ ra = UserAnalysis(dt) try: reader_popularity = ra.most_avid_readers(number) print(reader_popularity) except Exception as err: print((str(err)))
def task_5(user_uuid, book_uuid): ra = UserAnalysis(dt) try: find_user_books = ra.find_user_books(user_uuid) print("(a)list of all the document UUID read by that visitor") print(find_user_books) find_book_visitors = ra.find_book_visitors(book_uuid) print("(b)list of all the visitor UUIDs that read that document") print(find_book_visitors) except Exception as err: print((str(err)))
def task_6(user_uuid, book_uuid): ra = UserAnalysis(dt) try: user_book_alike_sorted = ra.users_alike_sorted(user_uuid, ra.sorter) print("(d)Sorted by readership profile for sorting the documents") print(user_book_alike_sorted) book_alike_sorted = ra.book_alike_sorted(book_uuid, ra.sorter) print("(e)Sorted by number of readers of the same document") print(book_alike_sorted) user_books_alike = ra.user_visitors_alike(user_uuid) print("(Extra)Similar users based on common book read") print(user_books_alike) visitors_books_alike = ra.book_visitors_alike(book_uuid) print("(Extra)Similar books based on user reader") print(visitors_books_alike) except Exception as err: print((str(err)))