Convert WhatsApp exports to Markdown/HTML with media linking/embedding.
Project description
whatsapp-export-md
Convert exported WhatsApp chats (Android/iOS) into Markdown or HTML, with proper handling of media:
- Recognizes
<attached: FILENAME>and bare filenames - Links media with relative paths or embeds via Base64 (
--embed) - Supports images, audio (incl.
.opus), video, and PDFs - Robust parsing of timestamps and multi‑line messages
- Optional JSON dump of parsed messages for further analysis
Privacy-friendly: runs completely locally on your machine.
Install
pip install whatsapp-export-md
Requires Python 3.9+
Quick start
# HTML with embedded media (up to 8 MB each)
whatsapp-export-md --input "/Exports/Family Chat.txt" --media-dir "/Exports/Family Chat" --out "/Exports/family_chat.html" --format html --embed --embed-max-mb 8
# Markdown without media embedding
whatsapp-export-md --input "/Exports/Project Team.txt" --out "project_team.md" --format md --title "Project Team"
Recommended folder layout:
/Exports/
Chat.txt
Chat/ # WhatsApp-created media folder for that chat
IMG-....jpg
VID-....mp4
00001234-AUDIO....opus
chat.html # save your output here
Features
- Android/iOS export formats, system messages
- Per‑day grouping and clean HTML layout
- Linkify plain
http(s)://URLs - Smart filename resolution:
- case‑insensitive
- ignores brackets
(1)and spacing/underscore/dash differences
- Correct MIME mapping for
.opus,.m4a,.pdf
CLI
usage: whatsapp-export-md --input INPUT --out OUT [--format {md,html}] [--media-dir DIR]
[--embed] [--embed-max-mb N] [--tz ZONE] [--title TITLE] [--json PATH]
Options:
--input PATH Exported WhatsApp .txt file
--out PATH Output file (.md or .html)
--format md|html Output format (default: md)
--media-dir DIR Path to the exported media folder (optional)
--embed Inline media as Base64 data URIs (HTML only)
--embed-max-mb N Max per-file embed size in MB (default: 8)
--tz ZONE Display timezone (default: Asia/Kolkata)
--title TITLE Document title
--json PATH Also dump parsed JSON
Tips
- For large videos, consider not embedding (
--embedoff) to keep HTML size small. - PDFs are shown via
<embed>when embedded, otherwise linked. - If you see a note like “Could not resolve these media tokens”, confirm that the files exist in
--media-dir. The resolver handles common renames (e.g.,file.pdfvsfile (1).pdf).
Development
git clone https://github.com/mshammas/whatsapp-export-md
cd whatsapp-export-md
pip install -e ".[test]"
License
MIT © Mohammed Shammas
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file whatsapp_export_md-0.1.7.tar.gz.
File metadata
- Download URL: whatsapp_export_md-0.1.7.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
48030b349c114276013278a6e0959b188c0b82261c8086d0719c3a765b6b0f60
|
|
| MD5 |
10026a3271d668faf5e42cd544076f6d
|
|
| BLAKE2b-256 |
59fe6d716d25989f94180bdffb6e82abd33fba6d4ba423d93b11a2b0b61a8bcb
|
File details
Details for the file whatsapp_export_md-0.1.7-py3-none-any.whl.
File metadata
- Download URL: whatsapp_export_md-0.1.7-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77fc624027eab64ddd09ee948118a8cf362ab18f22faa813af5aca9213017947
|
|
| MD5 |
ae5ac554e128bfa453b9139184734209
|
|
| BLAKE2b-256 |
bb20fdec810e23d065d824bc771d23bc46138461103a0b2841b9c4ec1fdea196
|