使用来自http://511.org的传输数据的python api。
fiveoneone的Python项目详细描述
511中转
使用来自http://511.org的传输数据的python api。
为了使用这个库,您需要注册一个511.org developer token。
示例用法
fromfiveoneone.routeimportRoutefromfiveoneone.stopimportStoptoken="YOUR_DEVELOPER_TOKEN"route=Route(token,"SFMTA","45-Union Stockton","45",True)stop=Stop(token,"Union St and Buchanan St","17056")departures=stop.next_departures(route.code,"Outbound")print"{} Outbound will arrive to {} in {} minutes".format(route.code,stop.name,departures.times[0])# 45 Outbound will to Union St and Buchanan St in 5 minutes
- 其他用法见tests/test_integration.py。
运行测试
requirements.dev.txt包含运行测试的所有需求。之后,从repo根do运行所有可用的测试:
nosetests