Skip to content

HeronSky/TR-Dashboard

Repository files navigation

TR-Dashboard

English | 中文


TR-Dashboard is a tool based on Streamlit, making the timetable of Taiwan Railways more visualize and interactive.After selecting the date, user can click on any station on the map to display the timetable of that day

The timetable data is automatically update with GitHub Actions and TDX API. Different colors on the map represent the number of train stops at the station on that day.

How to use?

Click station for station timetable, click segment for trains on that segment.

Route Density

  • Red: More than 150 train stops on the route on that day
  • Orange: 100 ~ 150 train stops on the route on that day
  • Yellow: 50 ~ 100 train stops on the route on that day
  • Green: Fewer than 50 train stops on the route on that day

Map Legend

  • Red: More than 150 train stops at the station on that day
  • Orange: 100 ~ 150 train stops at the station on that day
  • Green: 50 ~ 100 train stops at the station on that day
  • Gray: Fewer than 50 train stops at the station on that day

File Structure

├── main.py
├── api_tra.py
├── requirements.txt
├── data/
└── .github/workflows/
    └── update.yml
.yml

Setup and Run

  1. Install dependencies
    pip install -r requirements.txt
  2. Run the app
    streamlit run main.py

Notes

  • The automation workflow and part of the code in this project were developed with AI assistance.

TR-Dashboard 是一個基於 Streamlit 的互動式台鐵時刻表。使用者在選擇日期後並且在地圖上點擊車站,側邊欄將會顯示當日的時刻表,時刻表資料是透過 GitHub Actions 取得 TDX平台 的資料進行自動更新。地圖上的不同的顏色代表該車站當日的停靠車輛的數量。

互動方式

點擊車站可看該站列車,點擊路段可看該路段通過列車。

路段車流量

  • 紅色:該路段當日停靠的車輛數量大於150列
  • 橙色:該路段當日停靠的車輛數量在100列~150列
  • 黃色:該路段當日停靠的車輛數量在50列~100列
  • 綠色:該路段當日停靠的車輛數量小於50列

地圖標示

  • 紅色:該車站當日停靠的車輛數量大於150列
  • 橙色:該車站當日停靠的車輛數量在100列~150列
  • 綠色:該車站當日停靠的車輛數量在50列~100列
  • 灰色:該車站當日沒有停靠的車輛小於50列

檔案結構

├── main.py
├── api_tra.py
├── requirements.txt
├── data/
└── .github/workflows/
    └── update.yml
.yml

執行與安裝

  1. 安裝套件
    pip install -r requirements.txt
  2. 執行應用程式
    streamlit run main.py

備註

  • 本專案的自動化邏輯與部分程式碼是在 AI 的協助下完成開發。