Exemplo n.º 1
0
    args = vars(parser.parse_args())
    return args


if __name__ == "__main__":
    pd.set_option('display.width', 240)
    args = parse_args()
    input_file_operative = args['input_file_operative']
    input_file_usage = args['input_file_usage']
    output_file_applications = args['output_file_applications']
    output_file_users = args['output_file_users']

    analysis_start_time = datetime.datetime.now()

    odf = data_helper.import_operative_data(input_file_operative)
    udf = data_helper.import_usage_data(input_file_usage)

    print("Total number of apps: {}".format(len(odf)))
    print("Total number of events: {} with time range from {} to {} ".format(
        len(udf), udf['datetime'].min(), udf['datetime'].max()))

    application_summary = analyze.summarize_applications(odf, udf)
    application_summary.to_csv(output_file_applications,
                               sep=';',
                               encoding='utf-8')

    user_summary = analyze.summarize_users(odf, udf)
    user_summary.to_csv(output_file_users, sep=';', encoding='utf-8')

    print("Analysis took {} seconds".format(datetime.datetime.now() -
                                            analysis_start_time))
Exemplo n.º 2
0
 def setUpClass(self):
     self.odf = data_helper.import_operative_data(_OPERATIVE_TEST_DATA_FILE)
     self.udf = data_helper.import_usage_data(_TEST_DATA_FILE)
     self.users = analyze.summarize_users(self.odf, self.udf)