1
0
Fork
You've already forked chat-visualizer
0
Extract messages from messenger databases and generate HTML chat copies.
  • Python 61.8%
  • HTML 38.2%
Find a file
2021年09月05日 22:10:38 +02:00
templates Template: Fix indentation, add charset 2021年09月05日 21:56:04 +02:00
.gitignore Initial commit 2021年09月06日 03:26:53 +08:00
chat-visualizer.py Remove destination parameter, output always to source directory for media access 2021年09月05日 21:53:26 +02:00
LICENSE Initial commit 2021年09月06日 03:26:53 +08:00
README.md Add README 2021年09月05日 22:10:38 +02:00

Chat Visualizer

This repository hosts a small command line utility that is able to extract messages from messenger databases and generate HTML chat copies.

Background

Probably all messengers store a local copy of all or some messages in a local database. There are many reasons why one might want to access this database without using the messenger application itself, e.g. for backup and archiving purposes. This tool aims to read databases of as many messengers as possible and extract the contained messages to a portable, long-term compatible, visually appealing, accessible and easily readable format.

Usage

chat-visualizer$ python chat-visualizer.py -h
usage: chat-visualizer.py [-h] [--type {whatsapp}] data_dir
Create HTML visualizations from supported messenger data
positional arguments:
 data_dir Path to the data directory
optional arguments:
 -h, --help show this help message and exit
 --type {whatsapp} Type of the data to parse, e.g. messenger name

Limitations

Access to the chat database

Access to the chat database used by the messenger is required to use this tool. Getting access to this database may be non-trivial, depending on the messenger, platform and technical knowledge. For iOS, you can use libimobiledevice to create backups, decrypt them using mobile verification toolkit, and extract the WhatsApp data using ios-backup-extractor.

Supported messengers

So far, only WhatsApp databases are supported. While support for other messengers (e.g. Signal, Threema) is planned, it is unclear whether or when this will happen.

One-man project

This is a one-man project which only took a couple of hours to create from scratch. There may be bugs and performance / style issues. Please be careful when running this on a real backup (e.g. create a backup of your backup - backup-ception!)

Few tests

This has only been tested with one backup of a WhatsApp database from 2018 on iOS, extracted from an iPhone backup with ios-backup-extractor that was created with libimobiledevice (idevicebackup2 v1.3.1). While it should also work with other platforms and versions, this has not been tested yet. If you use this software, please report both working and failed results, so we can triage possible bugs.

Dependencies

Python 3 as well as the following modules are required to run this utility:

  • sqlite3
  • argparse
  • os
  • jinja2
  • datetime
  • enum
  • mimetypes

Most of them come preinstalled with standard Python installations. If not, use your system package manager or pip to install them.

Contributing

Contributions are very welcome. Feel free to

  • Report successful usage
  • Report bugs
  • Request features
  • Contribute code via pull requests
  • Package this utility for your distribution

ToDo

There's room for lots of improvement. A few examples are listed here:

  • Add support for other messengers
    • Signal (desktop and mobile)
    • Threema
  • Localization
  • Support for user-supplied themes
  • Supply visually improved themes
  • Add option to export the generated HTML to a different directory together with media
  • Check if all message types are supported (WhatsApp)
  • Enlarge media
  • Limit extraction to only some chats or time span