Giter Club home page Giter Club logo

pittapi's Introduction

Pitt API

Build Status License GPLv2 Python >= 3.6

Made by Ritwik Gupta at the University of Pittsburgh in an effort to get more open data from Pitt.

Usage examples

from PittAPI import course, dining, lab, laundry, library, news, people, shuttle, textbook

### Courses
# Will return a list of dictionaries containing courses in subject
cs_subject = course.get_term_courses(term='2194', subject='CS')
cs_course = cs_subject['1501']
cs_section_list = cs_course.sections
big_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.com
small_dict = textbook.get_textbook(term="3150", department="CS", course="445", instructor="RAMIREZ")

### Library
# Will return a dictionary containing results from query
big_dict = library.get_documents(query="computer")

### News
# Will return a list of dictionaries containing news from main news feed
medium_dict = news.get_news()

### Laundry
# Will return a dictionary with amount of washers and dryers
# in use vs. total washers and dryers at building
small_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 OS
small_dict = lab.get_status(lab_name="ALUMNI")

### Shuttle
# Will return a list of dictionaries containing routes of shuttles
big_dict = shuttle.get_routes()

### People
# Will return a list of people based on the query
list_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")

Tests

Run tests with python3 -m "nose" --with-coverage --cov PittAPI/ --with-timer tests/*.
If your python -v is 3+, replace python3 with python.

License

This project is licensed under the terms of the GPLv2 license.

pittapi's People

Contributors

ritwikgupta avatar azharichenko avatar dzheng256 avatar rahi374 avatar jdsleppy avatar richie78321 avatar rohit-ganguly avatar ethanwelsh avatar doomki avatar rchatrath7 avatar dependabot[bot] avatar adrienac avatar jeffzheng13 avatar fishofpitt116 avatar johnlinahan avatar varughese avatar omribarak avatar timparenti avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.