从pitt和pitt相关应用程序获取数据的api。

PittA的Python项目详细描述


Build StatusLicense GPLv2Python 3.4, 3.5, 3.6

由匹兹堡大学的Ritwik Gupta为了 更多来自皮特的公开数据。

用法示例

fromPittAPIimportcourse,dining,lab,laundry,library,news,people,shuttle,textbook### Courses# Will return a list of dictionaries containing courses in subjectcs_subject=course.get_term_courses(term='2194',subject='CS')cs_course=cs_subject['1501']cs_section_list=cs_course.sectionsbig_dict=cs_section_list[0].to_dict()### Textbook# Will return a list of dictionaries containing textbooks for a class# term number comes from pitt.verbacompare.comsmall_dict=textbook.get_textbook(term="3150",department="CS",course="445",instructor="RAMIREZ")### Library# Will return a dictionary containing results from querybig_dict=library.get_documents(query="computer")### News# Will return a list of dictionaries containing news from main news feedmedium_dict=news.get_news()### Laundry# Will return a dictionary with amount of washers and dryers# in use vs. total washers and dryers at buildingsmall_dict=laundry.get_status_simple(building_name="TOWERS")### Computer Lab# Will return a dictionary with status of the lab, and amount# of machines with a certain OSsmall_dict=lab.get_status(lab_name="ALUMNI")### Shuttle# Will return a list of dictionaries containing routes of shuttlesbig_dict=shuttle.get_routes()### People# Will return a list of people based on the querylist_of_peeps=people.get_person(query="Smith")### Dining# Will return a dictionary of dictionaries containing each dining location,# with its name, its open/closed status, and open times (if it exists)medium_dict=dining.get_locations()medium_dict=dining.get_locations_by_status(status="open")medium_dict=dining.get_locations_by_status(status="closed")# Will return a single dictionary of a dining location,# with its name, its open/closed status, and open times (if it exists)one=dining.get_location_by_name("taco_bell-schenley_cafe")two=dining.get_location_by_name("cup_&_chaucer-hillman")

测试

使用 python3 -m "nose" --with-coverage--cov PittAPI/ --with-timer tests/*.
如果python -v是3+,则用python替换python3

许可证

这个项目是根据GPLv2 license的条款授权的。

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

推荐PyPI第三方库


热门话题
java评级星显示错误   如何在java中使用ElasticsearchRepository使用elasticsearch分页实现逻辑   java我无法使用Spring MVC 3访问jsp页面   java自定义QR码,将QR码边改为圆角,而不是方形,是否要更改代码的颜色?   java为什么Httpclient只能获取202,而浏览器可以获取图像内容   java如何设置R.string。本例中的资源名称   swing我为Tictatcoe游戏编写了这个java程序,但它似乎不起作用   java有没有合适的算法来连接字符串,使多个字符串只能以唯一的组合连接?   java如何检查一个列表中是否存在小于等于另一个列表中元素的元素   java干净的登录数据   在Java中测试私有方法   java使用InputMismatchException try/catch块   java简单Hibernate映射建议   java将字符串转换为整型以用于准备状态   java在2D网格中查找对象距离的百分比