Skip to content

Latest commit

Β 

History

History
105 lines (77 loc) Β· 2.64 KB

File metadata and controls

105 lines (77 loc) Β· 2.64 KB

πŸ“Š YouTube Data Analysis & Sentiment Dashboard

This project analyzes trending YouTube videos and user comments using the YouTube Data API. It performs sentiment analysis, extracts insights on viewer engagement, and visualizes results through an interactive Streamlit dashboard.

πŸš€ Features

  • πŸ”„ Fetch trending YouTube videos and metadata
  • πŸ’¬ Collect and analyze user comments
  • 🧠 Perform sentiment analysis using VADER and TextBlob
  • πŸ“ˆ Trend analysis of channels and videos
  • 🌐 Region-wise filtering and visualization
  • πŸ“Š Interactive dashboard built with Streamlit

πŸ› οΈ Tech Stack

  • Languages & Tools: Python, SQL, Streamlit
  • Libraries: Pandas, Matplotlib, SQLAlchemy, TextBlob, VADER Sentiment
  • API: YouTube Data API (v3)
  • Database: PostgreSQL

πŸ—‚οΈ Project Structure

.
β”œβ”€β”€ analyze_trends.py         # Analyzes top comments and channels  
β”œβ”€β”€ dashboard.py              # Streamlit dashboard  
β”œβ”€β”€ sentiment_analysis.py     # VADER-based sentiment scoring  
β”œβ”€β”€ trending-videos.py        # Pulls trending videos from YouTube API  
β”œβ”€β”€ video-comments.py         # Fetches video comments & applies sentiment (TextBlob)  
β”œβ”€β”€ youtube-channels.py       # Fetches channel info  
β”œβ”€β”€ requirements.txt          # Python dependencies  

πŸ“¦ Setup Instructions

1. Clone the Repository

git clone https://github.com/aida-solat/youtube-data-analysis.git
cd youtube-data-analysis

2. Set Up Python Environment

python -m venv venv
source venv/bin/activate  # on Windows: venv\Scripts\activate
pip install -r requirements.txt

3. Configure PostgreSQL

Make sure PostgreSQL is installed and running. Then:

  • Create a database named youtube-data-analysis
  • Update credentials if needed in the .py files

4. Set Up YouTube Data API


▢️ How to Run

Collect Data

python trending-videos.py
python video-comments.py

Perform Sentiment Analysis

python sentiment_analysis.py

Analyze Trends

python analyze_trends.py

Launch Dashboard

streamlit run dashboard.py

πŸ“Š Dashboard Preview

The dashboard allows you to:

  • Select a region (e.g., US, IN, GB)
  • View top comments by likes
  • Generate word clouds
  • Explore sentiment distributions

🀝 Contributing

Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.