📱Demystifies your messages and allows for easy analysis and visualization of conversations.
Project description
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
- Generate tailored visualizations such as word clouds or a radial heatmap that plots hour of the day versus 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 |
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 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')
Future improvements
- Add support for identifying attachments
- 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.0.0.tar.gz
(22.7 kB
view details)
Built Distribution
File details
Details for the file demesstify-2.0.0.tar.gz
.
File metadata
- Download URL: demesstify-2.0.0.tar.gz
- Upload date:
- Size: 22.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9f13dfcf681b7959ddf144ea33715470f05d9ff28a1869583af89b7e2f3a743 |
|
MD5 | ef4ee68086363f06b87a67d7d3e17ab8 |
|
BLAKE2b-256 | 1de28e96b63f5518fda9c3cd70e3f39f63fecdd7b3f038feba477b82e96005dd |
File details
Details for the file demesstify-2.0.0-py3-none-any.whl
.
File metadata
- Download URL: demesstify-2.0.0-py3-none-any.whl
- Upload date:
- Size: 34.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 325d05a1680c4608eb47fa277850354a8a2d38aae0b6a8081c928fbee7d6ab02 |
|
MD5 | a7db8f1c0490a984342ace208d18379b |
|
BLAKE2b-256 | 59e6242dd1471f6e066fa0d103114be3947a36c48133eafe9134841c3692c5bd |