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. This project requires Python 3.5 or above. This WILL NOT WORK on Python 3.4 or lower.
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
To retrieve a list of professors, you have to first specify the school:
ratemyprofessor.get_school_by_name("School Name")
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")
This will return a list of School
s.
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 Professor
s.
Documentation
I am currently working on documentation but as of now there is no documentation yet. Sorry!
Example
import ratemyprofessor
professor = ratemyprofessor.get_professor_by_school_and_name(
ratemyprofessor.get_school_by_name("Case Western Reserve University"), "Connamacher")
if professor is not None:
print("%sworks in the %s Department of %s." % (professor.name, professor.department, professor.school.name))
print("Rating: %s / 5.0" % professor.rating)
print("Difficulty: %s / 5.0" % professor.difficulty)
print("Total Ratings: %s" % professor.num_ratings)
if professor.would_take_again is not None:
print(("Would Take Again: %s" % round(professor.would_take_again, 1)) + '%')
else:
print("Would Take Again: N/A")
Output:
Harold Connamacher works in the Computer Science Department of Case Western Reserve University.
Rating: 4.7 / 5.0
Difficulty: 3.8 / 5.0
Total Ratings: 102
Would Take Again: 86.2%
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. This serves as an inspiration for this project. This project is also licensed under the Apache 2.0 License. See LICENSE for more details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file RateMyProfessorAPI-1.3.0.tar.gz
.
File metadata
- Download URL: RateMyProfessorAPI-1.3.0.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9a887f6deca37f4fd1f41f03eb38b1659e37caf7b19a87c2ab1745332a5b92e |
|
MD5 | aa1a55e7e46f1ec6f79fb99843d59806 |
|
BLAKE2b-256 | f7755eae1e722ca9a1c78aaaa4f9b7d93725b4e01ad35ddb5cbd7530f12c6708 |
File details
Details for the file RateMyProfessorAPI-1.3.0-py3-none-any.whl
.
File metadata
- Download URL: RateMyProfessorAPI-1.3.0-py3-none-any.whl
- Upload date:
- Size: 12.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf9af4f59ec16eef858fdc2f10def16d0afeb2563072758ccd48756a165e0b7b |
|
MD5 | cc7bf7a456a9b70c18f65caf231b2786 |
|
BLAKE2b-256 | ac20c53cd8d2f82ee63665d78504db04da35677773b753650a29849807a1db5c |