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 versionexport_type (
Optional
[Literal
[‘Tabular’, ‘STATA’, ‘SPSS’, ‘Binary’, ‘DDI’, ‘Paradata’]]) – Format of the export datainterview_status (
Optional
[Literal
[‘All’, ‘SupervisorAssigned’, ‘InterviewerAssigned’, ‘RejectedBySupervisor’, ‘Completed’, ‘ApprovedBySupervisor’, ‘RejectedByHeadquarters’, ‘ApprovedByHeadquarters’]]) – What interviews to include in the exportexport_status (
Optional
[Literal
[‘Created’, ‘Running’, ‘Completed’, ‘Fail’, ‘Canceled’]]) – Status of the export jobhas_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$Versionexport_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 filegenerate (
bool
) – generate new export if no existing result setisfies the specified filterslimit_age (
Optional
[int
]) – only return export file if created less thanlimit_age
minutes agolimit_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
objectwait (
bool
) – ifTrue
will wait for the process to complete, otherwise, exit right away
- Returns
ExportJobResult
object
- cancel(job_id)¶