Skip to main content

Export Signal conversations to Markdown and HTML

Project description

signal-export

cicd publish PyPI version

Export chats from the Signal Desktop app to Markdown and HTML files with attachments. Each chat is exported as an individual .md/.html file and the attachments for each are stored in a separate folder. Attachments are linked from the Markdown files and displayed in the HTML (pictures, videos, voice notes).

Currently this seems to be the only way to get chat history out of Signal!

Adapted from mattsta/signal-backup, which I suspect will be hard to get working now.

Example

An export for a group conversation looks as follows:

[2019-05-29, 15:04] Me: How is everyone?
[2019-05-29, 15:10] Aya: We're great!
[2019-05-29, 15:20] Jim: I'm not.

Images are attached inline with ![name](path) while other attachments (voice notes, videos, documents) are included as links like [name](path) so a click will take you to the file.

This is converted to HTML at the end so it can be opened with any web browser. The stylesheet .css is still very basic but I'll get to it sooner or later.

🚀 Installation with Docker

This tool has some pretty difficult dependencies, so it's easier to get some help from Docker. For most people this will probably be the easiest way. It requires installing Docker and then pulling a 200MB image, so avoid this if data use is a concern.

First off, install Docker. And make sure you have Python installed.

Then install this package:

pip install signal-export

Then run the script! It will do some Docker stuff under the hood to get your data out of the encrypted database.

sigexport ~/signal-chats
# output will be saved to the supplied directory

See Alternative installation methods below for other ways to get it working.

Usage

Please fully exit your Signal app before proceeding, otherwise you will likely encounter an I/O disk error, due to the message database being made read-only, as it was being accessed by the app.

See the full help info:

sigexport --help

Disable pagination on HTML, and overwrite anything at the destination:

sigexport --paginate=0 --overwrite ~/signal-chats

List available chats and exit:

sigexport --list-chats

Export only the selected chats:

sigexport --chats=Jim,Aya ~/signal-chats

You can add --source /path/to/source/dir/ if the script doesn't manage to find the Signal config location. Default locations per OS are below. The directory should contain a folder called sql with db.sqlite inside it.

  • Linux: ~/.config/Signal/
  • macOS: ~/Library/Application Support/Signal/
  • Windows: ~/AppData/Roaming/Signal/

You can also use --old /previously/exported/dir/ to merge the new export with a previous one. Nothing will be overwritten! It will put the combined results in whatever output directory you specified and leave your previos export untouched. Exercise is left to the reader to verify that all went well before deleting the previous one.

Alternative installation method

🌋 This is hard mode, and involves installing more stuff. Probably easy on macOS, slightly involved on Linux, and impossible on Windows.

Before you can install signal-export, you need to get sqlcipher working. Follow the instructions for your OS:

Ubuntu (other distros can adapt to their package manager)

Install the required libraries.

sudo apt install libsqlite3-dev tclsh libssl-dev

Then clone sqlcipher and install it:

git clone https://github.com/sqlcipher/sqlcipher.git
cd sqlcipher
./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="-lcrypto -lsqlite3"
make && sudo make install

macOS

  • Install Homebrew.
  • Run brew install openssl sqlcipher

Windows

Ubuntu on WSL2 should work! That is, install WSL2 and Ubuntu on Windows, and then follow the For Linux instructions and feel your way forward. But probably just give up here and use the Docker method instead.

Install signal-export

Then you're ready to install signal-export: (Note the [sql] that has been added!)

pip install signal-export[sql]

Then you should be able to use the Usage instructions as above.

Development

git clone https://github.com/carderne/signal-export.git
cd signal-export
pip install -e .[dev,sql]
pre-commit install

Run tests with:

make test

And check types with:

mypy sigexport/

Similar things

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

signal-export-1.4.2.tar.gz (56.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

signal_export-1.4.2-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file signal-export-1.4.2.tar.gz.

File metadata

  • Download URL: signal-export-1.4.2.tar.gz
  • Upload date:
  • Size: 56.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for signal-export-1.4.2.tar.gz
Algorithm Hash digest
SHA256 aee6475a3dde649dc278a7359938deac5689c7815549b3af3e35aeea32c733e4
MD5 7d2fc4f2d65c9da9ddc12c89b5f0a960
BLAKE2b-256 77d6555fecfbb47336753bdd521e2ad91e67309902e1e5b6ae9bdcb896d6cbf8

See more details on using hashes here.

File details

Details for the file signal_export-1.4.2-py3-none-any.whl.

File metadata

  • Download URL: signal_export-1.4.2-py3-none-any.whl
  • Upload date:
  • Size: 14.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for signal_export-1.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 040893531da7d19a4660a51467620cca4bae49e88b5d8b95606e832d086c6692
MD5 2c8fc8e4502ae1c47292c4fefb22bafb
BLAKE2b-256 aef8890f7028cfdcc24f9bdd517d8f9720c33ef9f956e4b8c764d4fe86b0e794

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page