Skip to content

haikhalfakhreez/ktm-schedule

Repository files navigation

KTM Komuter Timetable

KTM Komuter Malaysia train timetable. In tables and routes view.

Browse Website

About KTM Schedule

Last updated: July 2023

All data is sourced from the official KTM Komuter Timetable website up to the date of the last update mentioned above.

How data is extracted

All conversions are made using Python! ❤️

  1. Download train times in PDF format from https://www.ktmb.com.my/traintime.html.
  2. Convert all the PDF files to CSV format using Camelot.
  3. Manually check and correct the data in the CSV files, ensuring there are no trailing commas, and each train time is placed in the correct column.
  4. Convert all the CSV files to JSON format using Pandas.

Update (July 2023)

  • Updated all train times to the latest schedule (last updated: July 2023).
  • New feature added: a switch button to toggle between "to" and "from" stations on Route page.
  • Migrated the old Pages router to the new App router. Learn more.
  • Implemented URL parameters to store state, replacing the use of React context.
  • Integrated Camelot to directly convert PDF to CSV, eliminating the need for manual conversion to .docx.
  • Added page descriptions, improved SEO, and UI updates.