For comprehensive command-line instructions, see the User Documentation.
commcare-export \
--username <username> \
--project <project> \
--query <excel or json file> \
--output-format <csv, xls, xlsx, json, markdown, sql> \
--output <file name or SQL database URL>See commcare-export --help for the full list of options.
By default, commcare-export writes logs to commcare_export.log in
the current working directory. Log entries are appended across runs.
# Custom log directory
commcare-export --log-dir /path/to/logs --query my-query.xlsx --project myproject
# Disable file logging (console only)
commcare-export --no-logfile --query my-query.xlsx --project myprojectNote
The log directory will be created automatically if it doesn't exist.
If the directory cannot be created or written to, commcare-export
will fall back to console-only logging with a warning.
The --output option accepts a SQLAlchemy
connection string
following RFC-1738:
postgresql+psycopg2://user:password@localhost/mydatabase
mysql+pymysql://user:password@localhost/mydatabase
mssql+pyodbc://user:password@localhost/mydatabase?driver=ODBC+Driver+17+for+SQL+Server
For more connection string examples, see the User Documentation.