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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 2 Python 3

File details

Details for the file RateMyProfessorAPI-1.0.1.tar.gz.

File metadata

  • Download URL: RateMyProfessorAPI-1.0.1.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.1

File hashes

Hashes for RateMyProfessorAPI-1.0.1.tar.gz
Algorithm Hash digest
SHA256 d8f359ee7c17b0572446b5f4c4da3a56bb17f91944d0f87232e27b91d815cd15
MD5 200c907fac264ea61230b20b5f9015c2
BLAKE2b-256 cd4fde933026efb71e2f9ada462e4d00708a6b7eb93c75f3c69d4c24012961de

See more details on using hashes here.

File details

Details for the file RateMyProfessorAPI-1.0.1-py2.py3-none-any.whl.

File metadata

  • Download URL: RateMyProfessorAPI-1.0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.1

File hashes

Hashes for RateMyProfessorAPI-1.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e126dca801664adeb103413f977e60c0168a70bc668630caf5b8e03bc1ee4228
MD5 8882a1e7d9dca5ca24cf198c19c0c404
BLAKE2b-256 1f561c7617a583fe1afaa183936e831c050fe76d5ca95daa867f3f2760a50fe4

See more details on using hashes here.

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