The DET requires you to download Python to your computer. You will use a command-line interpreter tool to run the commcare-export script from the Python script library.

The CommCare Export Tool calls the CommCare API to export the data. The configuration for what data is exported and how it is formatted are provided to the tool via an Excel configuration file.

The export can be in the format of a file (Excel, CSV, or JSON) or to a specified database.

What is Python?

Python is a high-level, general-purpose programming language. It allows you to integrate systems more effectively.

It is used for:

  • Web development (server-side)

  • Software development

  • Scientific computing/ Data Science

  • System scripting

Python can connect to database systems and can be used to handle big data.

You need Python installed to use the commcare-export script. The script library is installed with Python. Installing the script allows the Data Export Tool to export your data from CommCare HQ.

What is a Query File?

A Query file is an Excel file (.xlsx) saved to the Python Scripts folder. 

  • The Query file specifies which data objects should be requested from the API and which values should be stored when the API payload is received. All other values that are not specified are discarded and not stored in the results set.

  • One query file can contain many tabs and can combine case and form data queries.

It’s common to have a single query file with one tab for each case or form that you want to export.

A template query file is provided here for cases and forms. 

You must provide the path to where the query file is saved in the commcare-export command.

E.g.,commcare-export --query /home/username/Documents/my-query-file.xlsx

Next Page: The Excel Query File >

  • No labels