📱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
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 |
calmap | For creating calendar heatmaps |
emoji | For working with emojis |
lorem | For creating dummy text |
Example usage
Basic example
First, import the demesstify
library.
import demesstify as dm
Next, create the iMessages object.
For this example, we will use the from_random
class method, which allows us to randomly generate the specified number of messages. These messages will be populated using lorem ipsum dummy text.
imessages = dm.iMessages.from_random(total_messages=10)
Now that we've created the iMessages object, we can analyze the messages.
For example, we can find the 3 most frequently used emojis and the number of times they appeared in the messages.
imessages.emojis.get_most_frequent(3)
Next, we can determine the total number of messages that were exchanged.
imessages.sent.get_total()
We can also find the average number of messages received per day.
imessages.received.get_average_per_day()
Then, we can calculate the number of times velit appears in the messages.
imessages.all.get_count_of_word('velit')
For even more analytics, we can create a MessageCloud object.
Because the MessageCloud
object is essentially a wrapper around the WordCloud
object of the wordcloud library, we have access to its parameters as well. This way, we can specify exactly what time of words we want to include in the statistics.
cloud = dm.MessageCloud(imessages)
cloud.min_word_length = 3
cloud.repeat = False # will not repeat any words
cloud.collocations = False # will not include pairs of words
cloud.include_numbers = False # will not include numbers
cloud.generate()
With the MessageCloud object, we can see which words were used the most frequently and how often.
cloud.words.get_most_frequent(5)
Future improvements
- Add support for identifying attachments
- Add support for other message sources, e.g. Android or social media platforms
- Add more interesting calculations and analyses
- Incorporate sentiment analysis
- 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
Built Distribution
Hashes for demesstify-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c58fa5bffc422126a2458e72260f76ded258f841d1a7d189b409ca3c67516f72 |
|
MD5 | a24fb16727e25a433edc8d95a2b239e4 |
|
BLAKE2b-256 | b3be302bb17c396da2d35a5d4b8ba1492f3c8de41751ad4d410a00fc8a337fd3 |