A comprehensive Python tool for analyzing and ranking student clubs based on their Instagram engagement and WhatsApp activity metrics. Features beautiful Rich-formatted output with progress tracking, detailed tables, and visual charts.
Club Analyser evaluates student clubs using multiple data sources:
- Instagram metrics: Posts, likes, comments, followers
- WhatsApp activity: Message count, participant engagement
- Event clustering: Automatic detection of club events from posting patterns
- Composite scoring: Weighted algorithm combining all metrics
- Colorful output with status indicators
- Progress bars with real-time updates
- Beautiful tables for rankings and metrics
- Styled panels and borders
- Medal emojis for top performers (π₯π₯π₯)
- Composite scoring algorithm with configurable weights
- Event detection from Instagram posting patterns
- Normalized rankings for fair comparison
- Category-based grouping and analysis
- Engagement rate calculations
- Multiple chart types: Bar charts, scatter plots, radar charts
- High-resolution exports (PNG format)
- Interactive matplotlib displays
- Category distribution analysis
- Python 3.7+
- Instagram account cookies (for authentication)
- WhatsApp chat export files
-
Clone or download the project
cd /path/to/club-analyser -
Install dependencies
pip install -r requirements.txt
-
Configure club data in
main.py:clubs = [ Club( name="Your Club Name", insta_handle="instagram_handle", whatsapp_file="/path/to/whatsapp_export.txt", category="Tech" # or "Entertainment", etc. ), # Add more clubs... ]
-
Export WhatsApp chats:
- Open WhatsApp group
- Go to Group Info β Export Chat β Without Media
- Save as
.txtfile
-
Instagram Authentication:
- The tool uses
instaloaderwith browser cookies - For Linux systems, extract cookies from browser DevTools:
sessionidcsrftokends_user_id
- The tool uses
python main.pyThe tool will display:
- Welcome panel with project title
- Progress bar showing club processing status
- Real-time status for each club's data fetching
- Rankings table with comprehensive metrics
- Category breakdown with statistics
- Detailed summary with engagement rates
- Visualization export confirmation
ποΈ Club Analyser
ββ Starting Analysis ββ
β Club Analyser β
βββββββββββββββββββββββ
π Created 4 club objects
Processing clubs... ββββββββββββββββββββ 100% 0:02:15
π FINAL RANKINGS
ββββββββ¬ββββββββββββββ¬ββββββββββββββ¬ββββββββ¬ββββββββ¬ββββββββββββ¬βββββββββββ¬βββββββββ
β Rank β Club Name β Category β Score β Posts β Followers β Messages β Events β
ββββββββΌββββββββββββββΌββββββββββββββΌββββββββΌββββββββΌββββββββββββΌβββββββββββΌβββββββββ€
β π₯ 1 β Coding Club β Tech β 0.892 β 25 β 1,500 β 8,500 β 3 β
β π₯ 2 β Music Club β Entertainmentβ 0.745 β 18 β 1,200 β 6,200 β 2 β
ββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββ΄ββββββββ΄ββββββββββββ΄βββββββββββ΄βββββββββ
club-analyser/
βββ main.py # Main execution script
βββ club.py # Club data model
βββ instagram.py # Instagram data fetching
βββ whatsapp.py # WhatsApp chat parsing
βββ metrics.py # Scoring algorithms
βββ visualizer.py # Charts and Rich output
βββ grouping.py # Category management
βββ requirements.txt # Python dependencies
βββ README.md # This file
Modify weights in metrics.py:
DEFAULT_WEIGHTS = {
'avg_likes_per_post': 0.3,
'avg_comments_per_post': 0.2,
'followers_per_post': 0.3,
'avg_messages_per_participant': 0.2,
'posting_frequency': 0.1
}Adjust clustering parameters:
# In metrics.py
def cluster_posts_into_events(post_dates, max_gap_days=14):
# max_gap_days: Maximum days between posts in same eventCustomize Rich output in main.py and visualizer.py:
- Colors:
[red],[green],[blue],[yellow], etc. - Styles:
bold,dim,italic - Borders:
box.ROUNDED,box.DOUBLE,box.SIMPLE
certifi==2025.8.3
charset-normalizer==3.4.3
idna==3.10
instaloader==4.14.2
markdown-it-py==4.0.0
matplotlib==3.9.2
mdurl==0.1.2
numpy==2.1.1
Pygments==2.19.2
requests==2.32.5
rich==14.1.0
urllib3==2.5.0
- 401 Errors: Use browser cookie authentication instead of username/password
- Rate Limiting: Add delays between requests (currently 15 seconds)
- Regional Blocking: Use VPN or browser cookies from working session
- File Format: Ensure exported as plain text (.txt)
- Encoding: Use UTF-8 encoding for international characters
- File Path: Use absolute paths for WhatsApp files
- Empty Metrics: Check file paths and authentication
- Zero Scores: Verify data is being fetched correctly
- Missing Visualizations: Ensure matplotlib backend is properly configured
- Spinner animations during processing
- Progress bars with percentage completion
- Time elapsed tracking
- Task descriptions with current club being processed
- Colored columns for different data types
- Right-aligned numbers for better readability
- Medal emojis for rankings
- Formatted numbers with thousand separators
- Welcome panels with centered text
- Status panels for different operations
- Completion summaries with statistics
- File save confirmations
Add new categories by modifying club definitions:
Club(name="Art Club", category="Creative", ...)Process multiple club sets by creating separate club lists:
tech_clubs = [...]
entertainment_clubs = [...]
# Process separately or combine- PNG Charts: High-resolution visualization exports
- Rich Console: Beautiful terminal output
- Data Export: Extend to save CSV/JSON results
- Fork the repository
- Create feature branch
- Add Rich formatting for new features
- Test with sample data
- Submit pull request
This project is open source. Feel free to modify and distribute.
- Rich Library: For beautiful terminal output
- Instaloader: For Instagram data fetching
- Matplotlib: For chart generation
- NumPy: For numerical computations