📱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
- 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')
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 details)
Built Distribution
File details
Details for the file demesstify-2.2.0.tar.gz
.
File metadata
- Download URL: demesstify-2.2.0.tar.gz
- Upload date:
- Size: 25.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | afbd57641fc7388c54b6a114d845e29fc474a9fe9f14bb612cb55e9410f00bbe |
|
MD5 | ce23811e17b472d5187b4a9e891bbb9c |
|
BLAKE2b-256 | a212434e53c862b4aad6fe59d20733df99ac9393789fc01b36196109df8882a2 |
File details
Details for the file demesstify-2.2.0-py3-none-any.whl
.
File metadata
- Download URL: demesstify-2.2.0-py3-none-any.whl
- Upload date:
- Size: 38.3 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 | f68e291f89eafab2cc981a7c9f04ebc06d1c21d492edf37299d811318fd0bcd6 |
|
MD5 | 98b06997a1aa865e1f5838784f6cbb04 |
|
BLAKE2b-256 | 148943fe938e388d1f7cc405ff76fec3122d4e6b2a7921ac0dc40a5666881d56 |