Skip to content

A Python wrapper for SR and Korail train client service.

License

Notifications You must be signed in to change notification settings

Nitro1231/KoreaTrain

Repository files navigation

Korea-Train

A Python wrapper for korail2 and SRT.

Data Classes

class Parameter

Key Value Type Description KORAIL SR Default Value
dep str Departing Station Name USER INPUT REQUIRED
arr str Destination Station Name USER INPUT REQUIRED
date str Departing Date (yyyymmdd) Current Date
time str Departing Time (HHMMSS) Current Time
time_limit str Departing Time Upper Limit (HHMMSS) '240000'
train_type TrainType Train Type TrainType.ALL
passengers list[Passenger] List of Passengers [Passenger()]
heading Heading Heading of Seat Heading.DEFAULT
seat_location SeatLocation Location of Seat SeatLocation.DEFAULT
seat_type SeatType Seat Type SeatType.DEFAULT
reserve_option ReserveOption Reservation Options ReserveOption.GENERAL_FIRST

class Passenger

Key Value Type Description KORAIL SR Default Value
type_code PassengerType Passenger Type PassengerType.ADULT
count int Number of Passengers 1

Enums

Platform

Name Value
SR 0
KORAIL 1

TrainType

Name Value Description KORAIL SR
KTX '100' KTX
SAEMAEUL '101' 새마을호
MUGUNGHWA '102' 무궁화호
TONGGUEN '103' 통근열차
NURIRO '102' 누리로
ALL '109' 전체
AIRPORT '105' 공항직통
KTX_SANCHEON '100' KTX-산천
ITX_SAEMAEUL '101' ITX-새마을
ITX_CHEONGCHUN '104' ITX-청춘

PassengerType

Name Value Description KORAIL SR
ADULT 0 어른 - 만 13세 이상
CHILD 1 어린이 - 만 6세 ~ 12세 어린이
CHILD_UNDER_6 2 유아 - 만 6세 미만 유아
SENIOR 3 경로 - 만 65세 이상 경로
DISABILITY_1_TO_3 4 중증 - 장애의 정도가 심한 장애인(구1~3급)
DISABILITY_4_TO_6 5 경증 - 장애의 정도가 심하지 않은 장애인(구4~6급)

Heading

좌석 방향

Name Value Description KORAIL SR
DEFAULT '000' 기본
FORWARD '009' 순방향석
BACKWARD '010' 역방향석

SeatLocation

좌석 위치

Name Value Description KORAIL SR
DEFAULT '000' 기본
SINGLE '011' 1인석
WINDOW '012' 창측좌석
AISLE '013' 내측좌석

SeatType

좌석 종류

Name Value Description KORAIL SR
DEFAULT '015' 기본
CHILD '019' 유아동반 / 편한대화
LAPTOP '031' 노트북
MANUAL_WHEELCHAIR '021' 수동휠체어석
ELECTRIC_WHEELCHAIR '028' 전동휠체어석
NURSING_ROOM 'XXX' 수유실 인접
SECOND_FLOOR '018' 2층석
BIKE_RACK '032' 자전거거치대

ReserveOption

예약 옵션

Name Value Description KORAIL SR
GENERAL_FIRST 'GENERAL_FIRST' 일반실 우선
GENERAL_ONLY 'GENERAL_ONLY' 일반실
SPECIAL_FIRST 'SPECIAL_FIRST' 특실 우선
SPECIAL_ONLY 'SPECIAL_ONLY' 특실

About

A Python wrapper for SR and Korail train client service.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages