This script automates the booking process for Taiwan High-Speed Rail (THSR) tickets. It simplifies the task of booking train tickets by providing a user-friendly command-line interface. Note that this script does not support promotional or early bird tickets.
- Automates ticket booking for THSR.
- Validates user input for dates, times, and station numbers.
- Selects the train with the shortest travel time within an hour of the provided time slot.
- Supports booking tickets for travel between all THSR stations.
- Python 3.10 or higher.
- Internet connection.
- Compatibility with Windows, macOS, and Linux.
- Clone the Repository
git clone https://github.com/Raito-95/THSR-Ticket.git
- Navigate to the Directory
cd THSR-Ticket
- Install Required Packages
python -m pip install -r requirements.txt
Run the script using Python:
python ./thsr_ticket/main.py
Follow the script prompts to enter:
- Start Station (1-12)
- Destination Station (1-12)
- Date (YYYY/MM/DD)
- Time (HH:MM)
- ID Number
- Phone Number
- Email Address
To run the script in test mode using a JSON file for input:
python ./thsr_ticket/main.py -t profile.json
{
"start_station": "1",
"dest_station": "2",
"date": "YYYY/MM/DD",
"time": "HH:MM",
"ID_number": "",
"phone_number": "",
"email_address": ""
}
- Nangang
- Taipei
- Banqiao
- Taoyuan
- Hsinchu
- Miaoli
- Taichung
- Changhua
- Yunlin
- Chiayi
- Tainan
- Zuoying
If you encounter any issues, please ensure:
- Your Python version is 3.10 or higher.
- All required packages are installed.
- Your internet connection is stable.
This script is for demonstration purposes only. Users should comply with THSR's booking website terms of use.