Skip to main content

📱Demystifies your messages and allows for easy analysis and visualization of conversations.

Project description

Demesstify Logo

Demystify your messages.


GitHub last commit GitHub license PyPI Page PyPI Downloads


demesstify is a Python library that demystifies your messages and allows for easy analysis and visualization of conversations.


Table of contents

Main features

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

Installation

demesstify can be installed via pip:

pip install demesstify

The source code can be viewed on GitHub here.

Dependencies

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

Documentation

For information on how to use demesstify, please see the documentation.

Example usage

Analyzing the messages

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" appear 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()

Creating a word cloud

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')
Sample WordCloud

Future improvements

  • Add support for other message sources, e.g. Android or social media platforms
  • Add unit tests

Authors

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

demesstify-2.2.0.tar.gz (25.2 kB view hashes)

Uploaded Source

Built Distribution

demesstify-2.2.0-py3-none-any.whl (38.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page