コード例 #1
0
def export_spend_report(delta_days):
    path_manager = EnvManager()
    latest_date = comhelper.get_delta_date(int(delta_days))
    profit_resource_dir = ospath.join(
        "/var/www/html/eli/server/fakeProfitData", latest_date)
    # profit_resource_dir = path_manager.get_profit_resource_dir()
    facebook_file = ospath.join(profit_resource_dir, 'facebook_data.xlsx')

    profit_handler_dir = path_manager.get_profit_handler_dir()
    config_dir = ospath.join(profit_handler_dir, 'kpi_conf')
    af_handler = FakeDataHandler(config_dir, 'fake_super_conf.json')

    # output_dir = path_manager.get_output_dir()
    output_dir = ospath.join("/var/www/html/eli/server/fakeProfitData",
                             latest_date)

    facebook_data = ReadExcelDataHandler.read_facebook_data(facebook_file)

    calculate_data = af_handler.calculate_income(facebook_data)
    pivot_data = af_handler.group_data_by_country(calculate_data)

    _save_data_to_excel(output_dir, calculate_data, pivot_data)
コード例 #2
0
def export_spend_report(delta_days):
    path_manager = EnvManager()
    # latest_date = comhelper.get_delta_date(int(delta_days))
    # profit_resource_dir = ospath.join("/var/www/html/eli/server/profitData", latest_date)
    profit_resource_dir = path_manager.get_profit_resource_dir()
    appsflyer_file = ospath.join(profit_resource_dir, 'retention_data.xlsx')
    facebook_file = ospath.join(profit_resource_dir, 'facebook_data.xlsx')

    profit_handler_dir = path_manager.get_profit_handler_dir()
    config_dir = ospath.join(profit_handler_dir, 'kpi_conf')
    af_handler = AFDataHandler(config_dir, 'super_conf.json')

    output_dir = path_manager.get_output_dir()
    # output_dir = ospath.join("/var/www/html/eli/server/profitData", latest_date)

    appsflyer_data = ReadExcelDataHandler.read_appflyer_data(appsflyer_file)
    facebook_data = ReadExcelDataHandler.read_facebook_data(facebook_file)
    merge_data = af_handler.merger_data(facebook_data, appsflyer_data)

    calculate_data = af_handler.calculate_income(merge_data)
    pivot_data = af_handler.group_data_by_country(calculate_data)

    _save_data_to_excel(output_dir, calculate_data, pivot_data)