Skip to content

Sahid-22/Cricbuzz_LiveStats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🏏 Cricbuzz LiveStats Dashboard

A real-time cricket analytics dashboard built using Streamlit, MySQL, and the Cricbuzz RapidAPI feed. This project demonstrates a production-style data pipeline with API ingestion, transformation, storage, and interactive visualization.


🚀 Features

📊 Live Match Center

  • Real-time match listings (live + recent)
  • Venue, match status, and result details
  • Innings-wise score summary
  • Detailed batting and bowling scorecards

🧑‍💻 Top Player Stats

  • Top batters by total runs
  • Top bowlers by wickets
  • Leaderboards powered by SQL aggregations

🧠 SQL Analytics

  • 25 pre-built SQL practice queries
  • Read-only custom SQL runner
  • Real-world cricket dataset for analysis

🛠️ CRUD Operations

  • Insert, update, and delete player records
  • Manage match-level data

🔄 Data Pipeline (ETL)

  • Fetches live and recent matches from API
  • Stores matches, innings, batting, and bowling data in MySQL
  • Optimized refresh logic to avoid redundant API calls

🧠 Architecture

Cricbuzz API → Python ETL → MySQL Database → Streamlit Dashboard

🛠️ Tech Stack

  • Python
  • Streamlit
  • MySQL
  • pandas
  • requests
  • RapidAPI (Cricbuzz API)

📂 Project Structure

Cricbuzz_LiveStats/
│
├── app.py                # Main Streamlit app
├── run_refresh.py        # Data pipeline (ETL)
├── requirements.txt
├── README.md
│
├── pages/                # Streamlit pages
├── services/             # API + parsing + business logic
├── utils/                # DB + logging utilities
├── sql/                  # Schema + analytics queries

⚙️ Setup Instructions

1. Install dependencies

pip install -r requirements.txt

2. Configure environment variables

Create a .env file based on .env.example:

RAPIDAPI_HOST=cricbuzz-cricket.p.rapidapi.com
RAPIDAPI_KEY=your_api_key_here

DB_HOST=localhost
DB_PORT=3306
DB_USER=root
DB_PASSWORD=your_password
DB_NAME=cricbuzz_livestats

3. Create database schema

mysql -u root -p cricbuzz_livestats < sql/schema.sql

4. Run data pipeline

python run_refresh.py

5. Start Streamlit app

streamlit run app.py

📊 SQL Practice Pack

  • Contains 25 real-world analytical queries
  • Located in: sql/analytics_queries.sql
  • Integrated into the SQL Analytics page

⚠️ Important Notes

  • API usage is limited by RapidAPI quota
  • Some matches may not have scorecards (e.g., toss/preview stage)
  • Application falls back to stored database data if API is unavailable

📸 Screenshots

Add screenshots in an assets/ folder:

assets/Home.png
assets/Live.png
assets/Top Players.png
assets/Playing XI.png
assets/Commentary.png

👨‍💻 Author

Md Sahid Raza [sahidraza2000@gmail.com] +91 7205514001

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages