Python Interface for Octranspo API
python-ottawa-transit的Python项目详细描述
大蟒渥太华交通
指向OC Transpoapi的python接口和用于处理返回数据的实用程序。
安装
该包在PyPi上可用
pip install python-ottawa-transit
也可以使用Poetry
git clone https://github.com/buckley-w-david/python-ottawa-transit.git
cd python-ottawa-transit
poetry install
用法
>>>frompython_ottawa_transitimportOCTransportApi>>>api=OCTransportApi(app_id='APPLICATION_ID',app_key='APPLICATION_KEY')>>>api.get_route_summary_for_stop(stop_no=8435){"GetRouteSummaryForStopResult":{"StopNo":"8435","StopDescription":"BANK \\/ COLLINS","Error":"","Routes":{"Route":{"RouteNo":6,"DirectionID":1,"Direction":"Northbound","RouteHeading":"Rockcliffe"}}}}