Compare year-over-year (YoY) ridership trends for Bengaluru’s two major public transport agencies: BMTC (buses) and BMRCL / Namma Metro (metro rail). The app standardizes units, derives core KPIs, and visualizes long-term shifts in public transport usage.
- Goal: Provide a clean, defensible view of how BMTC and BMRCL ridership evolves year by year, with derived KPIs to support capacity planning, policy evaluation, and climate impact narratives.
- Stack: Python, pandas, plotly, Streamlit.
- Outputs: Interactive charts (trend, YoY growth, mode split), KPI cards, and a tidy table ready for export.
This Project was created as a contribution at the Bengaluru Climate Hackathon, hosted by WRI India, BBMP, OpenCity, BCAP and partners.
- BMTC Ridership Data — data.gov.in (Open Government Data)
- BMRCL Ridership Data — Wikipedia — Namma Metro (officially cited figures)
Notes
- BMTC is typically available as year-wise totals or average daily numbers.
- BMRCL often reports annual totals (in crore passengers). This dashboard converts to average daily (lakh) for an apples-to-apples comparison.
- BMTC Daily (lakh) — Average daily BMTC ridership, in lakh.
- Metro Daily (lakh) — Average daily BMRCL ridership, in lakh.
- Total PT(Passenger Traffic) Daily (lakh) =
BMTC Daily + Metro Daily
- Metro Share (%) =
(Metro Daily / Total PT Daily) × 100
- YoY Growth (%) of Total PT =
pct_change(Total PT Daily) × 100
Unit conventions: 1 crore = 100 lakh
.
If BMRCL provides annual (crore):
Metro Daily (lakh) = annual_crore × 100 / 365
.
The app expects a year-level table after ingestion/standardization. You can prepare it in two ways:
ridership_yoy.csv
(or .xlsx
) with columns:
Year | BMTC_Daily_Lakh | Metro_Daily_Lakh |
---|---|---|
2018 | 22.4 | 4.8 |
2019 | 23.1 | 5.6 |
2020 | 12.0 | 2.3 |
bmtc_yoy.csv
with columns:Year, BMTC_Daily_Lakh
bmrcl_yoy.csv
with columns:Year, Metro_Annual_Crore
orYear, Metro_Daily_Lakh
(If annual is provided, the app converts to daily in lakh using the formula above.)
Keep raw downloads in
data/raw/
and the clean/derived table indata/processed/
.
- Trend Line: Total PT Daily (lakh) over years, with BMTC vs Metro stacked or overlaid.
- Mode Split (Donut/Bar): Metro Share (%) for a selected year.
- YoY Growth Line/Bar: Year-over-year growth of Total PT (%).
- KPI Cards: Selected year’s values + Δ vs previous year.
- Events Overlay (optional): Policy changes (e.g., fare schemes), new line openings, pandemic years.
-
Requirements & KPI Scoping
Define the question (PT shift). Choose metrics: BMTC Daily (lakh), Metro Daily (lakh), Total PT Daily, Metro Share (%), YoY Growth (%). -
Data Sourcing
Identify sources: BMTC year-wise (data.gov.in), BMRCL annual (Wikipedia/Namma Metro). Note access limits (no station-wise; some pages lack APIs). -
Data Collection / Ingestion
Download CSV/XLSX, read into pandas. Keep raw files. Log source URLs and “Updated On” dates. -
Collation & Schema Design
Standardize columns →Year
,BMTC_Daily_Lakh
,Metro_Daily_Lakh
(orMetro_Annual_Crore
to derive). -
Cleaning & Normalization
Strip commas/strings, coerce numeric, ensure consistent units. Convert Metro annual crore → daily lakh withdaily_lakh = annual_crore × 100 / 365
. Handle missing/duplicate years. -
Feature Engineering
Total_PT_Daily_Lakh = BMTC_Daily_Lakh + Metro_Daily_Lakh
Metro_Share_Pct = Metro_Daily_Lakh / Total_PT_Daily_Lakh × 100
YoY_Growth_Pct = pct_change(Total_PT_Daily_Lakh) × 100
Round for display; keep full precision internally.
-
Packaging & Deployment
requirements.txt
(streamlit, plotly, pandas, openpyxl), optionalruntime.txt
. Deploy to Streamlit Cloud. Add “Data Sources” links in the footer.
# 1) Clone
git clone https://github.com/advik-holalu/Bengaluru-Public-Transport-Daily-Ridership-Dashboard.git
cd Bengaluru-Public-Transport-Daily-Ridership-Dashboard
# 2) (Optional) Virtual env
python -m venv .venv
# macOS/Linux:
source .venv/bin/activate
# Windows PowerShell:
# .\.venv\Scripts\Activate.ps1
# 3) Install
pip install -r requirements.txt
# 4) Run the app
streamlit run app.py
- Advik R Holalu
- Akshath S Bhandiwad
- Joselyn Riana Manoj
- K Jaidev Shankar Reddy
- Sanjan Dileep