Export

The export module contains methods to find and download an already generated data package, or trigger and manage a new generation job.

class ExportApi
get_list(questionnaire_identity=None, export_type=None, interview_status=None, export_status=None, has_file=None)

Get list of all previosly executed export jobs

Parameters
  • questionnaire_identity (Union[str, Tuple[str, int], None]) – Questionnaire and version

  • export_type (Optional[Literal[‘Tabular’, ‘STATA’, ‘SPSS’, ‘Binary’, ‘DDI’, ‘Paradata’]]) – Format of the export data

  • interview_status (Optional[Literal[‘All’, ‘SupervisorAssigned’, ‘InterviewerAssigned’, ‘RejectedBySupervisor’, ‘Completed’, ‘ApprovedBySupervisor’, ‘RejectedByHeadquarters’, ‘ApprovedByHeadquarters’]]) – What interviews to include in the export

  • export_status (Optional[Literal[‘Created’, ‘Running’, ‘Completed’, ‘Fail’, ‘Canceled’]]) – Status of the export job

  • has_file (Optional[bool]) – Whether the job has export file to download

get(questionnaire_identity, export_type='Tabular', interview_status='All', export_path='', generate=False, limit_age=None, limit_date=None, show_progress=False)

Downloads latest available export file

Parameters
  • questionnaire_identity (Union[str, Tuple[str, int]]) – Questionnaire id in format QuestionnaireGuid$Version

  • export_type (str) – Format of the export data: Tabular, STATA, SPSS, Binary, DDI, Paradata

  • interview_status – What interviews to include in the export: All, SupervisorAssigned, InterviewerAssigned, Completed, RejectedBySupervisor, ApprovedBySupervisor, RejectedByHeadquarters, ApprovedByHeadquarters

  • export_path (str) – Path to save the downloaded file

  • generate (bool) – generate new export if no existing result setisfies the specified filters

  • limit_age (Optional[int]) – only return export file if created less than limit_age minutes ago

  • limit_date (Optional[datetime]) – only return export file if created after the limit_date

get_info(job_id)
start(export_job, wait=False, show_progress=False)

Start new export job

Parameters
  • export_job (ExportJob) – ExportJobResult object

  • wait (bool) – if True will wait for the process to complete, otherwise, exit right away

Returns

ExportJobResult object

cancel(job_id)