signal-export


Namesignal-export JSON
Version 2.3.0 PyPI version JSON
download
home_pagehttps://github.com/carderne/signal-export
SummaryExport Signal conversations to Markdown and HTML
upload_time2024-04-27 16:27:50
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseMIT License
keywords backup chat export
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # signal-export
[![cicd](https://github.com/carderne/signal-export/actions/workflows/cicd.yml/badge.svg)](https://github.com/carderne/signal-export/actions/workflows/cicd.yml)
[![PyPI version](https://badge.fury.io/py/signal-export.svg)](https://pypi.org/project/signal-export/)

Export chats from the [Signal](https://www.signal.org/) [Desktop app](https://www.signal.org/download/) 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](https://github.com/mattsta/signal-backup), which I suspect will be hard to get working now.

## Example
An export for a group conversation looks as follows:
```markdown
[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: Windows
If you need step-by-step instructions on things like enabling WSL2, please see the dedicated [Windows Installation](./INSTALLATION.md) instructions.

In order to use this tool, you'll need to install WSL2, Docker and Python.
The steps to do this are below.
(**NB:** Improvements to these instructions are welcome.)

1. Enable Windows WSL2 feature
2. Install [Docker Desktop](https://docs.docker.com/get-docker/) with the WSL2 backend
3. Install Python 3.12 via Windows Store
4. In a PowerShell terminal, run
```bash
pip install signal-export
```
5. Run the script like this (you can enter any directory, it will be created)
```bash
sigexport C:\Temp\SignalExport
```
Run it without any arguments to get instructions about other options
```bash
sigexport
```

**NB** You may get an error like `term 'sigexport' is not recognized`, in which case you can use the following:
```bash
python -m sigexport.main ~/signal-chats
```

## 🐧 Installation: Linux
1. [Install Docker](https://docs.docker.com/get-docker/) (including following the [post-installation steps](https://docs.docker.com/engine/install/linux-postinstall/) for managing Docker as a non-root user).  
2. Make sure you have Python installed.

3. Install this package:
```bash
pip install signal-export
```

4. Then run the script! It will do some Docker stuff under the hood to get your data out of the encrypted database.
```bash
sigexport ~/signal-chats
# output will be saved to the supplied directory
```

### Linux without Docker
1. Install the required libraries.
```bash
sudo apt install libsqlite3-dev tclsh libssl-dev
```

2. Then clone [sqlcipher](https://github.com/sqlcipher/sqlcipher) and install it:
```bash
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
```

3. Then you can install and run signal-export without Docker:
```bash
pip install 'signal-export[sql]'
sigexport --no-use-docker ...
```

## 🍏 Installation: macOS
To use it with Docker, just follow the standard Linux instructions above.

### macOS without Docker
1. Install [Homebrew](https://brew.sh).
2. Run `brew install openssl sqlcipher`
3. Export some needed env vars:
```bash
export C_INCLUDE_PATH="$(brew --prefix sqlcipher)/include"
export LIBRARY_PATH="${brew --prefix sqlcipher)/lib"
```

4. Then you can install and run signal-export without Docker:
```bash
pip install 'signal-export[sql]'
sigexport --no-use-docker ...
```

## 🚀 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:
```bash
sigexport --help
```

Disable pagination on HTML, and overwrite anything at the destination:
```bash
sigexport --paginate=0 --overwrite ~/signal-chats
```

List available chats and exit:
```bash
sigexport --list-chats
```

Export only the selected chats:
```bash
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.

## 🗻 No-Python install
I don't recommend this, and you will have issues with file-ownership and other stuff.
You can also run the Docker image directly, it just requires copy-pasting a much-longer command and being careful with volume mounts.

First set the appropriate environment variables for your OS:
```bash
# Only enter one of these!
SIGNAL_INPUT="$HOME/.config/Signal"                             # Linux
SIGNAL_INPUT="$HOME/snap/signal-desktop/current/.config/Signal" # Snap
SIGNAL_INPUT="$HOME/Library/Application Support/Signal"         # macOS
SIGNAL_INPUT="$HOME/AppData/Roaming/Signal"                     # Powershell

# And your output location (must be an absolute path)
SIGNAL_OUTPUT="$HOME/Downloads/signal-output"
```

Then run the below command, which pulls in the environment variables you set above.
```bash
# Note that the --overwrite flag is necessary when running like this
# careful where you point it!
docker run --rm \
  --net none \
  -v "$SIGNAL_INPUT:/Signal:ro" \
  -v "$SIGNAL_OUTPUT:/output" \
    carderne/sigexport:latest \
    --overwrite /output \         # this line is obligatory!
    --chats Jim                   # this line isn't
```

Then you should be able to use the [Usage instructions](#usage) as above.

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

Various dev commands:
```bash
rye fmt         # format
rye lint        # lint
rye run check   # typecheck
rye run test    # test
rye run sig     # run signal-export
```

## Similar things
- [signal-backup-decode](https://github.com/pajowu/signal-backup-decode) might be easier if you use Android!
- [signal2html](https://github.com/GjjvdBurg/signal2html) also Android only

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/carderne/signal-export",
    "name": "signal-export",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "backup, chat, export",
    "author": null,
    "author_email": "Chris Arderne <chris@rdrn.me>",
    "download_url": "https://files.pythonhosted.org/packages/e3/3c/2f24aa030edc0d9976d71f36049e3daa4e1ebd251999f0bf5cacf4e4973d/signal_export-2.3.0.tar.gz",
    "platform": null,
    "description": "# signal-export\n[![cicd](https://github.com/carderne/signal-export/actions/workflows/cicd.yml/badge.svg)](https://github.com/carderne/signal-export/actions/workflows/cicd.yml)\n[![PyPI version](https://badge.fury.io/py/signal-export.svg)](https://pypi.org/project/signal-export/)\n\nExport chats from the [Signal](https://www.signal.org/) [Desktop app](https://www.signal.org/download/) 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).\n\nCurrently this seems to be the only way to get chat history out of Signal!\n\nAdapted from [mattsta/signal-backup](https://github.com/mattsta/signal-backup), which I suspect will be hard to get working now.\n\n## Example\nAn export for a group conversation looks as follows:\n```markdown\n[2019-05-29, 15:04] Me: How is everyone?\n[2019-05-29, 15:10] Aya: We're great!\n[2019-05-29, 15:20] Jim: I'm not.\n```\n\nImages 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.\n\nThis 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.\n\n## \ud83e\ude9f Installation: Windows\nIf you need step-by-step instructions on things like enabling WSL2, please see the dedicated [Windows Installation](./INSTALLATION.md) instructions.\n\nIn order to use this tool, you'll need to install WSL2, Docker and Python.\nThe steps to do this are below.\n(**NB:** Improvements to these instructions are welcome.)\n\n1. Enable Windows WSL2 feature\n2. Install [Docker Desktop](https://docs.docker.com/get-docker/) with the WSL2 backend\n3. Install Python 3.12 via Windows Store\n4. In a PowerShell terminal, run\n```bash\npip install signal-export\n```\n5. Run the script like this (you can enter any directory, it will be created)\n```bash\nsigexport C:\\Temp\\SignalExport\n```\nRun it without any arguments to get instructions about other options\n```bash\nsigexport\n```\n\n**NB** You may get an error like `term 'sigexport' is not recognized`, in which case you can use the following:\n```bash\npython -m sigexport.main ~/signal-chats\n```\n\n## \ud83d\udc27 Installation: Linux\n1. [Install Docker](https://docs.docker.com/get-docker/) (including following the [post-installation steps](https://docs.docker.com/engine/install/linux-postinstall/) for managing Docker as a non-root user).  \n2. Make sure you have Python installed.\n\n3. Install this package:\n```bash\npip install signal-export\n```\n\n4. Then run the script! It will do some Docker stuff under the hood to get your data out of the encrypted database.\n```bash\nsigexport ~/signal-chats\n# output will be saved to the supplied directory\n```\n\n### Linux without Docker\n1. Install the required libraries.\n```bash\nsudo apt install libsqlite3-dev tclsh libssl-dev\n```\n\n2. Then clone [sqlcipher](https://github.com/sqlcipher/sqlcipher) and install it:\n```bash\ngit clone https://github.com/sqlcipher/sqlcipher.git\ncd sqlcipher\n./configure --enable-tempstore=yes CFLAGS=\"-DSQLITE_HAS_CODEC\" LDFLAGS=\"-lcrypto -lsqlite3\"\nmake && sudo make install\n```\n\n3. Then you can install and run signal-export without Docker:\n```bash\npip install 'signal-export[sql]'\nsigexport --no-use-docker ...\n```\n\n## \ud83c\udf4f Installation: macOS\nTo use it with Docker, just follow the standard Linux instructions above.\n\n### macOS without Docker\n1. Install [Homebrew](https://brew.sh).\n2. Run `brew install openssl sqlcipher`\n3. Export some needed env vars:\n```bash\nexport C_INCLUDE_PATH=\"$(brew --prefix sqlcipher)/include\"\nexport LIBRARY_PATH=\"${brew --prefix sqlcipher)/lib\"\n```\n\n4. Then you can install and run signal-export without Docker:\n```bash\npip install 'signal-export[sql]'\nsigexport --no-use-docker ...\n```\n\n## \ud83d\ude80 Usage\nPlease 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.\n\nSee the full help info:\n```bash\nsigexport --help\n```\n\nDisable pagination on HTML, and overwrite anything at the destination:\n```bash\nsigexport --paginate=0 --overwrite ~/signal-chats\n```\n\nList available chats and exit:\n```bash\nsigexport --list-chats\n```\n\nExport only the selected chats:\n```bash\nsigexport --chats=Jim,Aya ~/signal-chats\n```\n\nYou can add `--source /path/to/source/dir/` if the script doesn't manage to find the Signal config location.\nDefault locations per OS are below.\nThe directory should contain a folder called `sql` with `db.sqlite` inside it.\n- Linux: `~/.config/Signal/`\n- macOS: `~/Library/Application Support/Signal/`\n- Windows: `~/AppData/Roaming/Signal/`\n\nYou can also use `--old /previously/exported/dir/` to merge the new export with a previous one.\n_Nothing will be overwritten!_\nIt will put the combined results in whatever output directory you specified and leave your previos export untouched.\nExercise is left to the reader to verify that all went well before deleting the previous one.\n\n## \ud83d\uddfb No-Python install\nI don't recommend this, and you will have issues with file-ownership and other stuff.\nYou can also run the Docker image directly, it just requires copy-pasting a much-longer command and being careful with volume mounts.\n\nFirst set the appropriate environment variables for your OS:\n```bash\n# Only enter one of these!\nSIGNAL_INPUT=\"$HOME/.config/Signal\"                             # Linux\nSIGNAL_INPUT=\"$HOME/snap/signal-desktop/current/.config/Signal\" # Snap\nSIGNAL_INPUT=\"$HOME/Library/Application Support/Signal\"         # macOS\nSIGNAL_INPUT=\"$HOME/AppData/Roaming/Signal\"                     # Powershell\n\n# And your output location (must be an absolute path)\nSIGNAL_OUTPUT=\"$HOME/Downloads/signal-output\"\n```\n\nThen run the below command, which pulls in the environment variables you set above.\n```bash\n# Note that the --overwrite flag is necessary when running like this\n# careful where you point it!\ndocker run --rm \\\n  --net none \\\n  -v \"$SIGNAL_INPUT:/Signal:ro\" \\\n  -v \"$SIGNAL_OUTPUT:/output\" \\\n    carderne/sigexport:latest \\\n    --overwrite /output \\         # this line is obligatory!\n    --chats Jim                   # this line isn't\n```\n\nThen you should be able to use the [Usage instructions](#usage) as above.\n\n## Development\n```bash\ngit clone https://github.com/carderne/signal-export.git\ncd signal-export\nrye sync --no-lock\n```\n\nVarious dev commands:\n```bash\nrye fmt         # format\nrye lint        # lint\nrye run check   # typecheck\nrye run test    # test\nrye run sig     # run signal-export\n```\n\n## Similar things\n- [signal-backup-decode](https://github.com/pajowu/signal-backup-decode) might be easier if you use Android!\n- [signal2html](https://github.com/GjjvdBurg/signal2html) also Android only\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Export Signal conversations to Markdown and HTML",
    "version": "2.3.0",
    "project_urls": {
        "Homepage": "https://github.com/carderne/signal-export",
        "Repository": "https://github.com/carderne/signal-export"
    },
    "split_keywords": [
        "backup",
        " chat",
        " export"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8373eac1caeab7e128b10e30b840a8b045a7da95591c944348e9e70b179eba1c",
                "md5": "0f3ac6242d36333fa5fe7bfa72cfac5f",
                "sha256": "4332549333cfcad92508dd0c6445956cf1d41ece786bbf26bcc6b4e3aeecc059"
            },
            "downloads": -1,
            "filename": "signal_export-2.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0f3ac6242d36333fa5fe7bfa72cfac5f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 19175,
            "upload_time": "2024-04-27T16:27:47",
            "upload_time_iso_8601": "2024-04-27T16:27:47.933873Z",
            "url": "https://files.pythonhosted.org/packages/83/73/eac1caeab7e128b10e30b840a8b045a7da95591c944348e9e70b179eba1c/signal_export-2.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e33c2f24aa030edc0d9976d71f36049e3daa4e1ebd251999f0bf5cacf4e4973d",
                "md5": "6a459002bebb6ea28b151a3ac63e9572",
                "sha256": "f082e7f79db9663a77f6449c97d07bcaf6542ccd0da284e2a1c4c37051e9baf2"
            },
            "downloads": -1,
            "filename": "signal_export-2.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "6a459002bebb6ea28b151a3ac63e9572",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 55861,
            "upload_time": "2024-04-27T16:27:50",
            "upload_time_iso_8601": "2024-04-27T16:27:50.009435Z",
            "url": "https://files.pythonhosted.org/packages/e3/3c/2f24aa030edc0d9976d71f36049e3daa4e1ebd251999f0bf5cacf4e4973d/signal_export-2.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-27 16:27:50",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "carderne",
    "github_project": "signal-export",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "signal-export"
}
        
Elapsed time: 0.25907s