def setUp(self): """Prepare for tests""" self.book_uuid = "110727005030-000000009cca70787e5fba1fda005c85" self.user_uuid = "938601f24509a9f1" bd = BookData('data/issuu_full.json') self.dt = bd.build_data_frame()
#!/usr/bin/python from classes.book_data import BookData from classes.document_analysis import DocumentAnalysis from classes.browser_analysis import BrowserAnalysis from classes.user_analysis import UserAnalysis import sys import getopt bd = BookData('data/100k.json') dt = bd.build_data_frame() def task_2(uuid): """Perform task from task 3 :param uuid: """ bs = DocumentAnalysis(dt) try: # By Countries result_countries = bs.countries_by_book(uuid) print("Views by country and Document UUID") print(result_countries) bs.counries_by_book_plot(result_countries, uuid) # By Continent print("Views by continent and Document UUID") result_continent = bs.continent_by_book(result_countries, uuid) bs.continent_by_book_plot(result_continent, uuid) print(result_continent) except Exception as err: print((str(err)))