Journey planner api client library
journeyplanner的Python项目详细描述
JourneyPlanner
用于访问行程规划器(rejseplanen)api的客户端。
安装
JourneyPlanner库可以使用pip安装:
$ pip install journeyplanner
示例
client = JourneyPlanner()
dt = datetime(2019, 1, 8, 12, 0, 0)
origin = Endpoint(latitude=55.68325233, longitude=12.57150292, name="noerreport")
destination = Endpoint(latitude=55.67271128, longitude=12.56635308, name="hovedbanen")
trip = client.trip(origin, destination, date=dt.date(), time=dt.time())
print(list(trip))
认证
client = JourneyPlanner()
client.authenticate('USERNAME', 'PASSWORD')
API参考
绊倒物体
trip实例具有以下属性:
Trip.legs
腿部实例列表
腿部物体
leg实例具有以下属性:
Leg.name
Leg.type
Leg.origin
Leg.destination
Leg.notes