So, I’m Akira, a computer engineer who recently had a dropoff in my coding output due to… well, covid-based issues, but even still, wanted to get back in the scheme of things, so I decided to build a pretty quick and dirty app that takes in as input the exported “.txt” file you can get from Whatsapp and it gives you a set of different indicators such as:
When you’ve talked to your friends the most
Who takes the longest to reply and how that has evolved through time
How long your conversations last and how that changed recently
I hope you guys enjoy it! This was loads of fun to make, and, if I’ve made any mistakes, I’d love some feedback since this was my first ever Streamlit App
Oh and it’s deployed on Heroku and Streamlit-sharing, if you guys would like to check it out:
St-share: Streamlit Sharing
Heroku: Heroku App
I love the idea (and that Gif! !) - Well done @akiragondo
If I may suggest one thing, it would be to allow users to try a sample file (with dummy and anonymised data) so they can see what your app is capable of!
I’ve added a sample file button and a little customization to the footer, you can check it out now through those same links above, thank you for your help!
Your previous advice of putting in a sample file donwload button was so extremely helpful, if I may ask, is there anything you think would be interesting to add to the app’s design?
Unfortunately your WhatsApp export format seems to be different from mine, so your parser does not work for me (“Whoops — something went wrong! An error has been logged.”). Maybe it is because I am using the german/iOS version of WhatsApp? My exported data looks like:
[07.02.14, 15:20:34] Max hat den Betreff zu “heute oder morgen” geändert.
[07.02.14, 15:21:31] Max wurde hinzugefügt.
[07.02.14, 15:21:31] Linda wurde hinzugefügt.
[07.02.14, 15:21:31] Timo wurde hinzugefügt.
[07.02.14, 15:20:52] Max: So jetzt mal Butter bei die Fische. Heute oder morgen?
[07.02.14, 15:20:55] Timo: Ja das wäre ne wichtige Frage
...
Yes! well, not a gif as in the image format, but it’s a Lottie animation, which basically does the same job but with less overhead (and you can use it directly through a web URL).
I would suggest you take a look at the st_lottie component from Streamlit and at the https://lottiefiles.com/, which contains a pretty large selection of those animations you can use with some attribution.
Oh! yes, so, the idea was for it to mostly support only english whatsapp exports in order to narrow the scope of the project (because for some reason whatsapp exports in wildly different formats depending on the language it’s in), but I will work on making it be able to parse the messages from the German version too!
I hope it can get you some interesting insights (I like average reply times the best)
Akira
Hey! I’ve made some changes to the source code, It should work with your exports now! Thanks for sending the example export too, it should now work (Though I haven’t properly tested with group chats as much so tell me if you find anything!)
Hi @akiragondo, thanks for the effort! There still seem to be some issues though.
On the streamlit share page, I get the same error as before.
On Heroku, I get the error
File "/app/.heroku/python/lib/python3.9/site-packages/streamlit/script_runner.py", line 350, in _run_script
exec(code, module.__dict__)
File "/app/main_page.py", line 118, in <module>
df = get_df_from_data(content)
File "/app/data_utils.py", line 67, in get_df_from_data
preprocessed = preprocess_df(df)
File "/app/data_utils.py", line 14, in preprocess_df
conv_codes, conv_changes = cluster_into_conversations(df)
File "/app/data_utils.py", line 74, in cluster_into_conversations
conv_delta[0] = 0
I had a quick look at your code and it seems that replacing the new line separator \\n with \n did the job.
Another minor issue I noticed is that your regex catches strange Subjects/“senders” of messages, which might be relevant with the group chat only. Here are some of them:
Subject: Linda left the group.
Subject: Max changed the topic to “Party Group”.
In my local playground I removed the Subjects based on a minimum threshold of messages to be sent. Here is a code example:
Hello! @tschmelzer, thank you so much for the suggestions!
I apologize for it, but it seemed like I needed to reboot my app on streamlit sharing, I haven’t tested it fully with large group chats, but I made a couple of different changes, including:
An improved regex line by line validator (so as to not catch group status messages like the ones you sent me)
Started using the readlines function instead of trying to split the rows manualy, which might work better usually, except maybe for windows phones
Thank you so much for the suggestions too! I’ll keep them in mind! In case the regex doesn’t fix the subjects issues, I’ll merge in the minimum message threshold you suggested
It was extremely useful to have an example export from the German/iOS version of WhatsApp, which really sped up the whole process, so, sincerely, thank you for bringing some of these issues to my attention and helping me walk through them!
I see you have posted an issue in my GitHub page, I will work on them as soon as I can, and thank you so much for donating your time for my project!
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.