demesstify is a Python library that demystifies your messages and allows for easy analysis and visualization of conversations.
Here are just a few things that demesstify
can do:
- Read message data from various sources, including your local iMessages database, a Tansee text file, or some randomly generated dummy text
- Perform text analysis on your messages so you can see things like the average number of texts received per day or the most number of messages that were sent in a row
- Analyze which emojis or reactions (if you're using iMessage) were most frequently used, among other thing
- Perform sentiment analysis on your messages to see the polarity of your conversations
- Calculate statistics about the attachments you exchanged (if you're using iMessage)
- Generate tailored visualizations such as word clouds or a radial heatmap that plots hour of the day against day of the week
demesstify
can be installed via pip:
pip install demesstify
The source code can be viewed on GitHub here.
demesstify
depends on the following packages:
Package | Description |
---|---|
pandas | For easy manipulation of message data |
matplotlib | For visualizations |
wordcloud | For creating wordclouds |
vaderSentiment | For sentiment analysis |
calmap | For creating calendar heatmaps |
emoji | For working with emojis |
lorem | For creating dummy text |
For information on how to use demesstify
, please see the documentation.
import demesstify as dm
from demesstify.analysis import emojis, sentiment, text
# Create the messages object and dataframes from dummy text
messages = dm.Messages.from_random(total_messages=1000)
all_df = messages.get_all()
sent_df = messages.get_sent()
received_df = messages.get_received()
# Determine the 3 most frequent emojis
most_frequent_emojis = emojis.Emojis(all_df).get_most_frequent(3)
# Determine the total number of messages sent
total_messages_sent = text.Text(sent_df).get_total()
# Determine the average number of messages received per day
average_received_daily = text.Text(received_df).get_average_per_day()
# Determine the number of times "velit" appears as a substring
velit_count = text.Text(all_df).get_count_of_substring('velit')
# Determine the average polarity of the messages
average_polarity = sentiment.Sentiment(all_df).get_average_sentiment()
import demesstify as dm
from demesstify.visualize import cloud
# Create the messages object and dataframes from dummy text
messages = dm.Messages.from_random(total_messages=1000)
# Create and save a Cloud object
wordcloud = cloud.Cloud(messages.as_string('all'))
wordcloud.min_word_length = 3
wordcloud.repeat = False # will not repeat any words
wordcloud.collocations = False # will not include pairs of words
wordcloud.include_numbers = False # will not include numbers
wordcloud.generate()
wordcloud.save('wordcloud.png')
- Add support for other message sources, e.g. Android or social media platforms
- Add unit tests