ChatExportPDF exports chat data from messenger sources into PDF reports.
Current sources:
threema(iOS database)threema_android_backup(encrypted Android data-backup ZIP)whatsapp
For each conversation, the exporter creates:
- a readable main PDF
- a
*_TECH.pdfreport - optionally, an Excel workbook with structured conversation data
The main report is generic. The TECH report can be importer-specific. The Threema iOS database importer has its own dedicated TECH report. Threema Android backups and WhatsApp use the generic fallback TECH report.
For Windows, use the standalone desktop app from the Releases page.
- Download
ChatExportPDF.exe. - Start the EXE. No Python installation is required.
- Select the source:
Threema iOS database: chooseThreemaData.sqlite; optionally choose_EXTERNAL_DATA.Threema Android backup: choose the encrypted data-backup.zipand enter its password.WhatsApp export: choose the exported WhatsApp.zip.
- Choose or keep the suggested output folder.
- Start the export.
python -m pip install -e .
python -m pip install pyinstaller
powershell -ExecutionPolicy Bypass -File .\packaging\windows\build_gui.ps1 -CleanThe EXE is written to dist\<timestamp>\ChatExportPDF.exe.
ThreemaData.sqlite- optional
_EXTERNAL_DATAfolder for attachment recovery
Typical source:
- iOS app container backup or extracted app data
Typical iOS paths:
/private/var/mobile/Containers/Shared/AppGroup/<AppID>/ThreemaData.sqlite/private/var/mobile/Containers/Shared/AppGroup/<AppID>/.ThreemaData_SUPPORT/_EXTERNAL_DATA
- encrypted data-backup
.zipcreated by the Threema Android app - backup password selected when the backup was created
- current backup format version
27 - direct chats, groups, distribution lists, participants, messages, reactions, polls, and attachment references
- media payloads are extracted when they were included in the backup and media export is enabled
- exported
.zipfile - the ZIP contains:
- a chat text file
- optional attachments with matching file names
Typical source:
- WhatsApp chat export ZIP created from the app itself
Supported WhatsApp export variants:
- Android-style chat text:
31.12.26, 12:00 - User: Message
- Apple-style chat text:
[31.12.26, 12:00:20] User: Message
If a WhatsApp ZIP contains multiple plausible .txt files, the exporter does not guess. In that case you must provide --chat-text-name.
In the selected output directory, the exporter creates:
export_summary.txt- human-readable run summary
manifest.json- machine-readable run manifest with settings, counts, hashes, and generated files
log.txt- full export log
conversations/- one readable PDF per conversation
- one
*_TECH.pdfper conversation
excel/- one
.xlsxworkbook per conversation if Excel export is enabled
- one
media/- extracted attachments per conversation if media export is enabled
Requirements:
- Python
3.10or newer pip
From the repository root, install the project:
python -m pip install -e .Recommended with external attachment folder:
python -m chat_export --source threema --input-path "./ThreemaData.sqlite" --out-dir "./export" --external-folder "./_EXTERNAL_DATA"The CLI prompts for the backup password without displaying it:
python -m chat_export --source threema_android_backup --input-path "./threema-backup.zip" --out-dir "./export"For non-interactive use, the password can be supplied with --backup-password. Be aware that command-line arguments can remain in shell history.
WhatsApp export:
python -m chat_export --source whatsapp --input-path "./WhatsApp-Chat mit Max Mustermann.zip" --out-dir "./export"WhatsApp ZIP with multiple plausible text files:
python -m chat_export --source whatsapp --input-path "./WhatsApp Chat - Max Mustermann.zip" --chat-text-name "_chat.txt" --out-dir "./export"Optional Excel export:
python -m chat_export --source whatsapp --input-path "./WhatsApp-Chat mit Max Mustermann.zip" --out-dir "./export" --excelThe preferred CLI entry points are:
chat-export ...python -m chat_export ...
--out-dir PATHOutput directory. It is created if it does not exist.
-
--source {threema,threema_android_backup,whatsapp}Selects the importer. Default:threema. -
--input-path PATHGeneric input path for the selected source.- for
threema: path toThreemaData.sqlite - for
threema_android_backup: path to the encrypted Android data-backup.zip - for
whatsapp: path to the exported.zip
- for
-
--db-path PATHLegacy alias for the Threema database path. -
--chat-text-name NAMEOnly relevant for WhatsApp. Forces a specific chat text file inside the ZIP when multiple plausible.txtfiles exist. -
--backup-password PASSWORDOnly relevant for Threema Android data backups. If omitted in an interactive terminal, the CLI prompts for it securely.
-
--external-folder PATHThreema iOS database only. Path to_EXTERNAL_DATA. Recommended for complete attachment export. -
--tz TIMEZONETimezone for rendered timestamps. Default:Europe/Zurich. -
--no-mediaDisable attachment export. PDFs are still generated. -
--no-image-previewsDisable inline image previews in the normal PDF export. By default, image previews are enabled when image attachments are available. -
--excelAlso export each conversation as an Excel workbook. PDFs are still generated. -
--max-media-bytes NSkip media blobs larger thanNbytes.0disables the limit. -
--limit-conversations NProcess only the firstNconversations.0means all. -
--limit-messages NProcess only the firstNmessages per conversation.0means all messages. -
--case-number TEXTOptional case or reference number written toexport_summary.txtandmanifest.json. -
--examiner TEXTOptional examiner name or initials written toexport_summary.txtandmanifest.json. -
--organization TEXTOptional organization or unit written toexport_summary.txtandmanifest.json. -
--case-description TEXTOptional case notes or description written toexport_summary.txtandmanifest.json.