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
Metadata
Release files for demesstify 2.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| demesstify-2.2.0.tar.gz | 25.2 kB | Without provenance | Details for demesstify-2.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| demesstify-2.2.0-py3-none-any.whl | Python 3 | none | any | Details for demesstify-2.2.0-py3-none-any.whl |
Total release size: 63.5 kB
Release files / demesstify-2.2.0.tar.gz
| Download URL | demesstify-2.2.0.tar.gz |
|---|---|
| Size | 25.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
afbd57641fc7388c54b6a114d845e29fc474a9fe9f14bb612cb55e9410f00bbe
|
|
BLAKE2b-256 checksum How to use checksums |
a212434e53c862b4aad6fe59d20733df99ac9393789fc01b36196109df8882a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.9
|
Release files / demesstify-2.2.0-py3-none-any.whl
| Download URL | demesstify-2.2.0-py3-none-any.whl |
|---|---|
| Size | 38.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f68e291f89eafab2cc981a7c9f04ebc06d1c21d492edf37299d811318fd0bcd6
|
|
BLAKE2b-256 checksum How to use checksums |
148943fe938e388d1f7cc405ff76fec3122d4e6b2a7921ac0dc40a5666881d56
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.9
|
Security for demesstify 2.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.