Client module

This module provides the AdDownloader Command-line Interface.

AdDownloader.cli.intro_messages()[source]

Display introductory messages and gather user input and Meta developer access token for selected task. After selecting the task, the respective function will be run.

AdDownloader.cli.request_params_task_AC()[source]

Prompt user for additional parameters for the API request in tasks A and C that involve ad data download from the Meta Ad Library.

Returns:

User-provided parameters.

Return type:

dict

AdDownloader.cli.run_analysis()[source]

Main function to run the AdDownloader tool until the user stops the analysis.

AdDownloader.cli.run_task_A(project_name, answers)[source]

Run task A: Download ads data from the Meta Online Ad Library based on user-provided parameters.

Parameters:
  • project_name (str) – The name of the current project.

  • answers (dict) – User’s answers from the initial questions for tasks A/C regarding desired parameters.

AdDownloader.cli.run_task_B(project_name, answers)[source]

Run task B: Download ads media content based on user’s choices.

Parameters:
  • project_name (str) – The name of the current project.

  • answers (dict) – User’s answers from the initial questions for tasks A/C regarding desired parameters.

  • file_name (str) – Name of the Excel file containing ads data. If none is provided data is taken from ‘output/project_name/ads/data/original_data.xlsx’