使用来自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

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java Hibernate会话/模板返回null   java Bluetooth无法连接到OBD2   smartGWT中的行分隔符的java等价物?   java如何删除可执行路径错误   java使用ICE Tar库对大文件进行Tar   java Spring Boot/JavaFX:添加一个仍然可以访问JPA的关机挂钩(ctrlc)   使用输入流读取java属性文件   如何在Java中迭代HashSet元素时覆盖该元素   内容类型中的javascript set charset=“utf8”   使用cassandra触发器的java   用户界面什么是适合我的GUI(JAVA)的update()方法   Java实例控制   java前置摄像头无法在不同设备上工作   java方法组织。postgresql。jdbc。连接。createClob()尚未实现