Skip to main content

Export Signal conversations to Markdown and HTML

Project description

signal-export

PyPI version

⚠️ NB: Because the latest versions of Signal Desktop protect the database encryption key, so decrypting involves some extra steps. Good luck.

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

  1. Make sure you have Python installed.

  2. Install this package:

pip install signal-export

# ...if you have the "pipx" command available, you're probably better off installing with "pipx install signal-export"
  1. Then run the script!
sigexport ~/signal-chats

# or for Windows:
python -m sigexport C:\Temp\SignalExport

🪟 Installation: Windows

If you need step-by-step instructions on things like enabling WSL2, please see the dedicated Windows Installation instructions.

Installation nix/nixOS

signal-export is packaged in nixpkgs, so you can run

nix-shell -I nixpkgs=channel:nixpkgs-unstable --packages signal-export --command 'sigexport ~/signal-chats'

If you get an error message about secret-tool not being found, you probably need to install libsecret-tools via your Linux package manager. If you get this on NixOS then just add libsecret in the previous command

nix-shell -I nixpkgs=channel:nixpkgs-unstable --packages signal-export libsecret --command 'sigexport ~/signal-chats'

🚀 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:

sigexport --paginate=0 ~/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/
  • Linux Flatpak: ~/.var/app/org.signal.Signal/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.

Development

git clone https://github.com/carderne/signal-export.git
cd signal-export
rye sync --no-lock

Various dev commands:

rye fmt         # format
rye lint        # lint
rye run check   # typecheck
rye run test    # test
rye run sig     # run signal-export

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-3.8.1.tar.gz (21.2 kB view details)

Uploaded Source

File details

Details for the file signal_export-3.8.1.tar.gz.

File metadata

  • Download URL: signal_export-3.8.1.tar.gz
  • Upload date:
  • Size: 21.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for signal_export-3.8.1.tar.gz
Algorithm Hash digest
SHA256 a3e678bd2aaed9abd0cb37fdde8e6cda12a608ad88f1aa05e091a52f333ff712
MD5 e4acdca7a4c2b6739dbd3ea90c8364a9
BLAKE2b-256 c08459807560188ad34ac4ea9c3c0c3b256a8e4e2ddf91eef6529d57f5895b4f

See more details on using hashes here.

Provenance

The following attestation bundles were made for signal_export-3.8.1.tar.gz:

Publisher: release.yml on carderne/signal-export

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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