Metadata-Version: 2.1
Name: imess
Version: 0.1.2
Summary: Analyze your iMessage data
Author: Michael Wornow
Project-URL: Homepage, https://github.com/Miking98/imess
Project-URL: Documentation, https://github.com/Miking98/imess
Project-URL: Source, https://github.com/Miking98/imess
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pandas==2.2.3
Requires-Dist: numpy==2.2.1
Requires-Dist: plotnine==0.14.4
Requires-Dist: matplotlib==3.10.0
Requires-Dist: mizani==0.13.1
Requires-Dist: wordcloud==1.9.4
Requires-Dist: stop-words==2018.7.23
Requires-Dist: nltk==3.9.1
Requires-Dist: wordfreq==3.1.1
Requires-Dist: stopwords==1.0.1
Requires-Dist: vobject==0.9.9
Requires-Dist: pytypedstream==0.1.0
Requires-Dist: pyarrow==18.1.0
Requires-Dist: phonenumbers==8.13.52
Requires-Dist: Levenshtein==0.26.1
Requires-Dist: calplot==0.1.7.5
Requires-Dist: tqdm==4.67.1

# iMessage Analysis

Python scripts to analyze your iMessage data. Completely private and locally hosted. Please see [TODO](__) for more details and examples.

![Example Plot](assets/example.png)

Table of Contents:
1. [💽 Installation](#installation)
2. [⚡️ Quickstart](#quickstart)
3. [🧑‍💻 Advanced](#advanced)


<a name="installation" />

## 💽 Installation
```bash
pip install imess
```

<a name="quickstart" />

## ⚡️ Quickstart

First, load your messages and contacts data.
```bash
# Copy data into /tmp/imess/ so that this script can access it
imess_init

# Preprocess data
imess_load
```

Second, generate plots:
```bash
# General plots (top-K) of all-time
imess_run --mode top_K_chats_with_sender_counts --K 20

# General plots (top-K) of chats over time
imess_run --mode top_K_chats_over_time --K 20

# Plots about a specific named group chat
imess_run --mode specific_chat_over_time --chat <chat-name>

# Plots about a specific set of senders
imess_run --mode specific_chat_over_time --senders <comma-separated-list-of-senders>

# Plots about a specific chat's word cloud
imess_run --mode specific_chat_word_cloud --senders <comma-separated-list-of-senders>

# Outputs all chat histories, one CSV and TXT per chat
imess_run --mode output_chat_history
```

All plots and outputs will be saved to `./plots/`.

<a name="advanced" />

## 🧑‍💻 Advanced

### Install

For local development:
```bash
conda create -n imess python=3.10 -y
conda activate imess
pip install -e .
```

### Merging Contacts

**TODO**

If you have contacts that you want to merge but don't think that's captured in the `contacts.vcf` file, you can provide a `data/merges.txt` file to `imless_load` to specify how you want to merge contacts.

First, create a `data/merges.txt` file. Each row is a separate contact that will be merged into a single contact. The row should contain a comma-separated list of contact info that will be merged into a single contact.

An example is below:

```
test@gmail.com,test@comcast.com,599-559-4499
1121122222,999-999-9999,mom@icloud.com
```

Anytime we see `test@gmail.com`, `test@comcast.com`, or `599-559-4499`, we will merge them into a single contact.

The script `imess_load` will automatically try to load `data/merges.txt`. If you don't want to use this file, you can set the `--path_to_merges_txt` flag to `None` or delete the file.

```bash
imess_load --path_to_merges_txt ./data/merges.txt
```
