Python/IPython code to analyze one's text messages. Intended to work out of the box.
Author: Michael Dezube <michael dezube at gmail dot com>
This code will:
- Find your latest iPhone sync (currently only supports doing this automatically on Macs), for PCs edit
table_connector.py
to find the file - Load up the messages database and address book database locally
- Merge the databases together into
fully_merged_messages_df
which you can freely play with - Visualize a word tree of your text messages with a specific contact
- Show you who you text the most
Note: none of your data is modified nor sent anywhere during execution
- Pandas, see Pandas install
- IPython follow Pandas install link for details how to install this as well
- An iPhone, having synced with this computer
- If running on a Mac, code will work out of the box. If running on a PC, change the variable
BASE_DIR
intable_connector.py
to the directory of your backups- This post seems to specify the location of backups on Windows.
- Internet connection to load the google visualization API, it's a very small file though
- Start the IPython notebook like so:
jupyter notebook sms_analysis.ipynb
- Under the menu choose Cell --> Run All
- Edit the
CONTACT_NAME
andROOT_WORD
in the last cell to alter the visualization and then re-run that cell, under menu choose: Cell --> Run Cell
Contact michaeldezube at gmail com with questions
Example word tree: