A professional multi-page Streamlit application for analyzing WhatsApp chat exports and converting images to PDF.
WhatsApp Message Counter
- Count messages per user and analyze user activity
- Search for specific keywords or phrases in chat history
- Filter messages within specific date ranges
- Identify most active members
- Export analysis results as text files
Image to PDF Converter
- Convert multiple images into a single PDF file
- Support for JPG, JPEG, and PNG formats
- Preserve image quality and order
- Generate downloadable PDF documents
- Batch conversion with progress tracking
whatsapp_stats/
├── main.py # Home page (entry point)
├── pages/
│ ├── __init__.py
│ ├── whatsapp_counter.py # WhatsApp message counter page
│ └── image_converter.py # Image to PDF Converter page
├── utils/
│ ├── __init__.py
│ ├── analyzer.py # WhatsApp analysis functions
│ └── image_converter.py # Image conversion functions
├── requirements.txt
├── Dockerfile
└── README.md
- Python 3.8+
- pip
-
Clone the repository
git clone <repository-url> cd whatsapp_stats
-
Create a virtual environment
# macOS / Linux python -m venv venv source venv/bin/activate # Windows python -m venv venv venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
Once installed, launch the Streamlit app:
streamlit run main.pyThe application will open in your default browser at http://localhost:8501
- Welcome message and application overview
- Feature descriptions for both tools
- Step-by-step usage guides
- Frequently asked questions
- Technical information and privacy details
- Navigation guide to other pages
- Upload WhatsApp chat export files
- View extracted group information
- Filter messages by date range
- Search for specific keywords
- View detailed user statistics
- Download analysis results as text files
- Upload multiple image files (JPG, PNG)
- Preview selected files before conversion
- View estimated PDF file size
- Convert to single PDF document
- Download generated PDF files
-
Export your WhatsApp chat:
- iPhone: Open chat → Contact info → Export Chat → Without Media
- Android: Open chat → Menu → More → Export Chat → Without Media
-
Navigate to "WhatsApp Message Counter"
-
Upload your .txt export file
-
View group information
-
Set optional filters:
- Date range (start and end dates)
- Keyword search (optional)
-
Click "Generate Statistics"
-
Review results and download if needed
- Prepare your image files (JPG, JPEG, or PNG)
- Navigate to "Image to PDF Converter"
- Upload one or more images
- Review the file list and estimated PDF size
- Click "Convert to PDF"
- Download the generated PDF file
utils/analyzer.py - WhatsApp analysis functions
extract_group_details(): Extract group name and creation infoget_date_range(): Get min/max dates from messagesanalyze_messages(): Analyze messages with filteringgenerate_analysis_report(): Generate formatted reports
utils/image_converter.py - Image conversion functions
validate_image_file(): Check if file is valid imageconvert_images_to_pdf(): Convert images to single PDFget_image_dimensions(): Get image dimensionsestimate_pdf_size(): Estimate resulting PDF size
- Clean, well-documented code with docstrings
- Modular structure for easy maintenance
- Separation of concerns (UI vs. logic)
- Proper error handling and user feedback
- Professional interface without visual clutter
- Memory-efficient image processing
- streamlit: Web framework for building data apps
- Pillow: Image processing library
- Python Standard Library: Collections, re (regex), datetime
The application includes a Dockerfile for containerized deployment.
To build and run with Docker:
docker build -t whatsapp-stats .
docker run -p 8501:8501 whatsapp-stats- Export a WhatsApp group chat as .txt
- Upload to "WhatsApp Message Counter"
- Leave dates as default for full analysis
- Enter keyword (e.g., "hello") or leave empty
- Click "Generate Statistics"
- Download the report
- Select 5-10 images from your device
- Go to "Image to PDF Converter"
- Upload all images at once
- Verify the file list
- Click "Convert to PDF"
- Download your merged PDF
- Parses standard WhatsApp export format
- Extracts timestamps, usernames, messages
- Filters by date range (optional)
- Searches keywords (whole word match)
- Calculates statistics per user
- Generates formatted report
- Validates image format (JPG, PNG)
- Converts all to RGB if needed
- Preserves aspect ratio
- Creates single PDF document
- Maintains file order (alphabetical)
WhatsApp Counter:
- Only supports .txt export format from WhatsApp
- Requires standard export format (DD/MM/YYYY HH:MM)
- Searches use whole-word matching
Image Converter:
- Supports JPG, JPEG, PNG only
- Images processed in alphabetical order by filename
- No data storage or logging
- No external uploads or API calls
- All processing done locally
- Files not retained after use
- GDPR and privacy compliant
Version: 2.1 (Image Converter Edition)
Last Updated: April 2026
Recent Updates:
- Added Image to PDF Converter feature
- Replaced placeholder page with functional utility
- Expanded Home page with comprehensive guides
- Improved error handling and user feedback
Feel free to fork, create issues, or submit pull requests for improvements!
This project is open source and available under the MIT License.
Made with care using Streamlit