Interactive CLI wrapper for imessage-exporter with contact name resolution and post-processing
Project description
imexp
An interactive CLI wrapper for imessage-exporter that adds contact name resolution and post-processing to your iMessage exports.
Features
- Interactive wizard — run
imexpwith no arguments for a guided export experience - Natural language dates — use phrases like "last 6 months" or "2 weeks ago"
- Contact resolution — automatically maps phone numbers and emails to names from your macOS or iOS Contacts database
- iOS backup support — auto-detects backups and lets you pick by device name/date
- Post-processing — renames exported files and replaces raw handles with contact names
- Export history — tracks your last export date to avoid duplicates
Requirements
- Python 3.12+
- macOS or Windows for the official wheels
macOS local Address Book lookups require macOS. iOS backup exports work on both macOS and Windows.
Installation
Install from PyPI:
pip install imexp
Official wheels bundle the matching imessage-exporter binary for:
- macOS Apple Silicon
- macOS Intel
- Windows x86_64
Source installs do not bundle the exporter binary. For editable or source installs, either:
- install
imessage-exporterseparately and keep it onPATH - point
IMEXP_EXPORTER_PATHat a local binary
Example source install:
git clone https://github.com/code-switched/imexp.git
cd imexp
pip install -e .
Usage
Interactive mode
Simply run with no arguments for the guided wizard:
imexp
You'll be prompted for:
- Platform (macOS or iOS backup)
- Date range (natural language supported)
- Export location
Command-line mode
imexp export --start-date "2024-01-01" --end-date "2024-06-01" --format txt
Relabel existing exports
Re-run contact resolution on a previous export:
imexp relabel --export-path ./data/messages/sms/2024-01-15-10-30-00
Common options
| Option | Description |
|---|---|
--start-date |
Start date (natural language or YYYY-MM-DD) |
--end-date |
End date (defaults to now) |
--format |
Output format: txt, html (default: txt) |
--platform |
macOS or iOS |
--db-path |
Path to iOS backup or custom chat.db |
--export-path |
Custom output directory |
--non-interactive |
Disable prompts for scripted use |
-v, --verbose |
Enable debug logging |
How it works
- Runs
imessage-exporterwith your specified options - Loads contacts from macOS Contacts.app or iOS backup
- Post-processes exported files:
- Renames files from phone numbers to contact names
- Replaces raw handles in file contents with names
- Saves unknown number → name mappings to
contacts.jsonfor future exports - Tracks export history in
history.jsonfor incremental exports
Configuration files
By default, files are stored in ./data/messages/sms/:
contacts.json— custom name overrides for unknown numbershistory.json— tracks last export date
License
imexp is distributed under GPL-3.0-or-later.
The official wheels bundle the upstream imessage-exporter binary, which is also licensed under GPL-3.0.
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
Built Distributions
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 imexp-0.1.0.tar.gz.
File metadata
- Download URL: imexp-0.1.0.tar.gz
- Upload date:
- Size: 46.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b61dd5309bd48ab18a69833d204b8489d5984440ea1f7e4b9ec4f6ff29dbe51
|
|
| MD5 |
bf7e7b7baeab7cfadaba736554a50d45
|
|
| BLAKE2b-256 |
4ba889bceb820a25c97be8b2ce377c9e55c6104979ffdfb73a2db8551fdc5175
|
Provenance
The following attestation bundles were made for imexp-0.1.0.tar.gz:
Publisher:
release.yml on code-switched/imexp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
imexp-0.1.0.tar.gz -
Subject digest:
6b61dd5309bd48ab18a69833d204b8489d5984440ea1f7e4b9ec4f6ff29dbe51 - Sigstore transparency entry: 1154233116
- Sigstore integration time:
-
Permalink:
code-switched/imexp@be8721a8892a6bd4bf726e386652beedf78a7eff -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/code-switched
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@be8721a8892a6bd4bf726e386652beedf78a7eff -
Trigger Event:
push
-
Statement type:
File details
Details for the file imexp-0.1.0-py3-none-win_amd64.whl.
File metadata
- Download URL: imexp-0.1.0-py3-none-win_amd64.whl
- Upload date:
- Size: 2.1 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f352c5b92ca0e9d63318c8360fc6802a4920fce3ffb248c881f9d8695a44419
|
|
| MD5 |
bbc614990029ba83a78834606d409767
|
|
| BLAKE2b-256 |
3efa997c9e79428031500f813b25c6f4b2b09f6fa7fb20689981eba1f7943094
|
Provenance
The following attestation bundles were made for imexp-0.1.0-py3-none-win_amd64.whl:
Publisher:
release.yml on code-switched/imexp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
imexp-0.1.0-py3-none-win_amd64.whl -
Subject digest:
4f352c5b92ca0e9d63318c8360fc6802a4920fce3ffb248c881f9d8695a44419 - Sigstore transparency entry: 1154233159
- Sigstore integration time:
-
Permalink:
code-switched/imexp@be8721a8892a6bd4bf726e386652beedf78a7eff -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/code-switched
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@be8721a8892a6bd4bf726e386652beedf78a7eff -
Trigger Event:
push
-
Statement type:
File details
Details for the file imexp-0.1.0-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: imexp-0.1.0-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.8 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4b9b27f83aaf575099f1745f87d5ab52a75c0dac9f0f2fe70a3f2fed7a24451
|
|
| MD5 |
01712250bdec703d4519a63e2b379af4
|
|
| BLAKE2b-256 |
85757ef718090067f148511db7118bdcf89650290d847bc1548a1ece6f2fb477
|
Provenance
The following attestation bundles were made for imexp-0.1.0-py3-none-macosx_11_0_arm64.whl:
Publisher:
release.yml on code-switched/imexp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
imexp-0.1.0-py3-none-macosx_11_0_arm64.whl -
Subject digest:
c4b9b27f83aaf575099f1745f87d5ab52a75c0dac9f0f2fe70a3f2fed7a24451 - Sigstore transparency entry: 1154233146
- Sigstore integration time:
-
Permalink:
code-switched/imexp@be8721a8892a6bd4bf726e386652beedf78a7eff -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/code-switched
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@be8721a8892a6bd4bf726e386652beedf78a7eff -
Trigger Event:
push
-
Statement type:
File details
Details for the file imexp-0.1.0-py3-none-macosx_10_12_x86_64.whl.
File metadata
- Download URL: imexp-0.1.0-py3-none-macosx_10_12_x86_64.whl
- Upload date:
- Size: 1.9 MB
- Tags: Python 3, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d3971a721344774b2cddb2b92a21810df2c4c0a5534ea1bffadc1d81610c039
|
|
| MD5 |
ac8803fb06c627f6703f933e6887b718
|
|
| BLAKE2b-256 |
fcf53f04a3d3e18f6d168d3c4b713fe0bf00c55d36d5ad8d493cc3d56e0f6d68
|
Provenance
The following attestation bundles were made for imexp-0.1.0-py3-none-macosx_10_12_x86_64.whl:
Publisher:
release.yml on code-switched/imexp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
imexp-0.1.0-py3-none-macosx_10_12_x86_64.whl -
Subject digest:
3d3971a721344774b2cddb2b92a21810df2c4c0a5534ea1bffadc1d81610c039 - Sigstore transparency entry: 1154233133
- Sigstore integration time:
-
Permalink:
code-switched/imexp@be8721a8892a6bd4bf726e386652beedf78a7eff -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/code-switched
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@be8721a8892a6bd4bf726e386652beedf78a7eff -
Trigger Event:
push
-
Statement type: