Skip to main content

Python web scraper to get professor ratings from ratemyprofessor.com website.

Project description

RateMyProfessorAPI

Setup

Please note that this has only been tested on Python 3.9.1. If this doesn't work for older versions, open up an Issue.

Install the package using the following command:

python -m pip install RateMyProfessorAPI 

To update the package, use the following command:

python -m pip install RateMyProfessorAPI --upgrade

To use the package in your program, please import the package:

import ratemyprofessor

Uninstallation

To uninstall the package, use the following command:

python -m pip uninstall RateMyProfessorAPI

Usage

As of version 1.0.0, there are limited ways to retrieve professor ratings. Only ratings, difficulty ratings, and names can be displayed at this time.

To retrieve a list of professors, you have to first specify the school:

ratemyprofessor.get_school_by_name("School Name here")

This will return None if no school is found corresponding with that name. Alternatively, to search for multiple schools, use

ratemyprofessor.get_schools_by_name("School Name here")

This will return a list of Schools.

Using the School object obtained from the previous commands, you can use that to find the professor:

ratemyprofessor.get_professor_by_school_and_name(school, "Professor Name") 

where school refers to a School object. Alternatively, to search for multiple professors, use

ratemyprofessor.get_professor_by_schools_and_name(school, "Professor Name") 

This will return a list of Professors.

Each Professor object has a rating, difficulty, id, and name.

Each School object has a 'id' and 'name'.

Example

import ratemyprofessor

professor = ratemyprofessor.get_professor_by_school_and_name(
    ratemyprofessor.get_school_by_name("Case Western Reserve University"), "Connamacher")
print(f"Professor name: {professor.name}")
print(f"Professor rating: {professor.rating} / 5.0")
print(f"Professor difficulty: {professor.difficulty} / 5.0")

Output:

Professor name: Harold Connamacher
Professor rating: 4.7 / 5.0
Professor difficulty: 3.8 / 5.0

See examples for more examples.

Acknowledgements and License

This can be seen as a continuation of the RateMyProfessorPyAPI project that can also be found on GitHub here. A lot of the code is reused in this package. As such, this project is also licensed under the Apache 2.0 License. See LICENSE for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

RateMyProfessorAPI-1.0.1.tar.gz (8.4 kB view hashes)

Uploaded Source

Built Distribution

RateMyProfessorAPI-1.0.1-py2.py3-none-any.whl (9.0 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page