Skip to content
unyacat edited this page May 27, 2023 · 4 revisions

get_stations(line) -> Stations

駅の情報を取得します。

内容

(神戸線の場合) https://www.train-guide.westjr.co.jp/api/v3/kobesanyo_st.json

使い方

引数

  • [必須] line: str = 路線(LINES)

戻り値

  • Stations

stations = jr.get_stations(line="kobesanyo")
print(stations.stations[0].info)
# >> name='新大阪' code='0415' stopTrains=[1, 2, 5] typeNotice=None transfer=[TransferItem(name='JR京都線', type=0, code='kyoto', link='kyoto', linkCode='0415'), TransferItem(name='おおさか東線', type=0, code='osakahigashi', link='osakahigashi', linkCode='0415'), TransferItem(name='新幹線', type=1, code='shinkansen', link=None, linkCode=None), TransferItem(name='御堂筋線', type=3, code='midosuziline', link=None, linkCode=None)] line=None pairDisplay=None lines=None

Clone this wiki locally