Important
This tool is specifically optimized for WhatsApp chats exported in Turkish. Click here for the Turkish README / Türkçe README için tıklayın
A comprehensive Python-based analyzer for WhatsApp chat exports. Transform your raw chat logs into professional, insightful PDF reports featuring detailed statistics, temporal analysis, and natural language insights.
- Message Metrics: Total messages, word counts, and letter counts per participant.
- Poll Statistics: Track how many polls each user has created.
- Engagement Analysis: Participation rates and average messages per active day.
- Media Tracking: Detailed breakdown of Stickers, Images, Videos, Audio, Documents, GIFs, and Locations.
- Advanced Tokenization: Smart handling of WhatsApp @mentions and context-aware apostrophe handling (keeps "word's" for n-grams, splits for counts).
- N-Gram Analysis: Discover frequently used Bigrams and Trigrams to identify common catchphrases.
- Emoji Stats: See each user's favorite and most frequent emojis.
- Word Frequency: Top words used overall and per user (filtered for meaningful results).
- Activity Heatmap: Analysis of message volume by hour of the day and day of the week.
- Monthly Trends: Track how your conversation has evolved over months.
- Peak Days: Identify the top 10 most active days in your chat history.
- Robust Regex: Automatically filters out "edited" and "deleted" message indicators from statistics.
- System Message Detection: intelligently excludes group formation, name changes, and system notifications.
- Call Statistics: Accurate counts for Voice, Video, Answered, and Missed calls.
- Python 3.8 or higher
- GTK+3 (Required by WeasyPrint for PDF generation)
-
Clone the Repository
git clone https://github.com/ataberkcemunal/ChatStatsForWhatsApp.git cd ChatStatsForWhatsApp -
Setup Virtual Environment (Recommended)
python3 -m venv venv source venv/bin/activate # On macOS/Linux
-
Install Dependencies
pip install -r requirements.txt
-
Export your WhatsApp chat:
- Open the desired chat on your mobile device.
- Go to More > Export Chat.
- Select Without Media.
- Save the exported
.txtfile to the project directory (e.g., as_chat.txt).
-
Generate Report:
python ChatStatsForWhatsApp.py _chat.txt
-
View Results: Open the newly generated
chat_stats.pdfto explore your statistics.
You can find an example report in the root directory:
- SAMPLE_REPORT.md: A comprehensive Markdown report generated from a simulated chat dataset (Turkish).
The generated PDF report features:
- Rich Typography: Optimized for readability using modern sans-serif fonts.
- Structured Layout: Organized with emoji-enhanced headers and clean Markdown-style tables.
- Turkish Support: Fully optimized for Turkish language exports and character sets.
The script is designed to be plug-and-play, but you can easily modify MEDIA_PATTERNS or group_patterns within ChatStatsForWhatsApp.py to adapt to different WhatsApp localized versions if needed.
Distributed under the MIT License. See LICENSE for more information.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Created with ❤️ by Ataberk Cem Ünal