Metadata-Version: 2.4
Name: commcare-export
Version: 1.16.0
Summary: A command-line tool (and Python library) to extract data from CommCare HQ into a SQL database or Excel workbook
Author-email: Dimagi <information@dimagi.com>
License: MIT
Project-URL: Homepage, https://github.com/dimagi/commcare-export
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Healthcare Industry
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: System Administrators
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Database
Classifier: Topic :: Software Development :: Interpreters
Classifier: Topic :: System :: Archiving
Classifier: Topic :: System :: Distributed Computing
Requires-Python: <3.15,>=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: alembic
Requires-Dist: backoff>=2.0
Requires-Dist: jsonpath-ng~=1.6.0
Requires-Dist: ndg-httpsclient
Requires-Dist: openpyxl==3.1.5
Requires-Dist: python-dateutil
Requires-Dist: pytz
Requires-Dist: requests
Requires-Dist: simplejson
Requires-Dist: sqlalchemy~=2.0
Provides-Extra: test
Requires-Dist: mypy; extra == "test"
Requires-Dist: psycopg2-binary; extra == "test"
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-unmagic; extra == "test"
Requires-Dist: ruff; extra == "test"
Requires-Dist: types-python-dateutil; extra == "test"
Requires-Dist: types-pytz; extra == "test"
Requires-Dist: types-requests; extra == "test"
Requires-Dist: types-simplejson; extra == "test"
Provides-Extra: base-sql
Requires-Dist: SQLAlchemy; extra == "base-sql"
Requires-Dist: alembic; extra == "base-sql"
Provides-Extra: postgres
Requires-Dist: SQLAlchemy; extra == "postgres"
Requires-Dist: alembic; extra == "postgres"
Requires-Dist: psycopg2-binary; extra == "postgres"
Provides-Extra: mysql
Requires-Dist: SQLAlchemy; extra == "mysql"
Requires-Dist: alembic; extra == "mysql"
Requires-Dist: pymysql; extra == "mysql"
Provides-Extra: odbc
Requires-Dist: SQLAlchemy; extra == "odbc"
Requires-Dist: alembic; extra == "odbc"
Requires-Dist: pyodbc; extra == "odbc"
Provides-Extra: delta
Requires-Dist: deltalake[pyarrow]<2,>=1.6; extra == "delta"
Provides-Extra: xlsx
Requires-Dist: openpyxl; extra == "xlsx"
Provides-Extra: xls
Requires-Dist: xlwt; extra == "xls"
Provides-Extra: executable
Requires-Dist: chardet; extra == "executable"
Requires-Dist: psycopg2-binary; extra == "executable"
Requires-Dist: pymysql; extra == "executable"
Requires-Dist: pyodbc; extra == "executable"
Requires-Dist: xlwt; extra == "executable"
Requires-Dist: openpyxl; extra == "executable"
Dynamic: license-file

CommCare Data Export Tool
========================

https://github.com/dimagi/commcare-export

[![Build Status](https://github.com/dimagi/commcare-export/actions/workflows/test.yml/badge.svg)](https://github.com/dimagi/commcare-export/actions)
[![Test coverage](https://coveralls.io/repos/dimagi/commcare-export/badge.png?branch=master)](https://coveralls.io/r/dimagi/commcare-export)
[![PyPI version](https://badge.fury.io/py/commcare-export.svg)](https://badge.fury.io/py/commcare-export)

A command-line tool (and Python library) to generate customized exports
from the [CommCare HQ](https://www.commcarehq.org)
[REST API](https://wiki.commcarehq.org/display/commcarepublic/Data+APIs).


Quick Start
-----------

### Installation

```shell
uv pip install commcare-export
```

### Basic Usage

```shell
# Export forms to Markdown (useful for testing)
commcare-export \
    --query examples/demo-registration.xlsx \
    --project YOUR_PROJECT \
    --output-format markdown

# Export to a SQL database with incremental updates
commcare-export \
    --query examples/demo-registration.xlsx \
    --project YOUR_PROJECT \
    --output-format sql \
    --output postgresql://user:pass@localhost/dbname

# Export to Delta Lake tables in cloud storage with incremental updates
commcare-export \
    --query examples/demo-registrations.xlsx \
    --project YOUR_PROJECT \
    --output-format delta \
    --output az://container/commcare \
    --checkpoint-database-url sqlite:///checkpoints.db
```

Example query files are provided in the [examples/](examples/) directory
for both Excel and JSON formats.


Documentation
-------------

### For Users

See the [User Documentation](https://dimagi.atlassian.net/wiki/spaces/commcarepublic/pages/2143955952/CommCare+Data+Export+Tool+DET)
for installation, creating queries, command-line usage, scheduling, and
common use cases.

### For Developers

See the [Technical Documentation](docs/index.md) for:

- [Python Library Usage](docs/library-usage.md) - Using `commcare-export` as a Python library
- [MiniLinq Reference](docs/minilinq-reference.md) - Query language documentation
- [Query Formats](docs/query-formats.md) - Excel and JSON query specifications
- [Output Formats](docs/output-formats.md) - Available output formats and dependencies
- [User and Location Data](docs/user-location-data.md) - Exporting organization data
- [Command-line Usage](docs/cli-usage.md) - CLI reference
- [Scheduling](docs/scheduling.md) - Running DET on a schedule


Contributing
------------

We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for
how to set up your development environment, coding style guidelines,
testing, and the release process.

- [Testing Guide](docs/testing.md)
- [Changelog](https://github.com/dimagi/commcare-export/releases)


Python Versions
---------------

Tested with Python 3.10, 3.11, 3.12, and 3.13.


License
-------

MIT License - see [LICENSE](LICENSE) for details.
