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.6.tar.gz
.
File metadata
- Download URL: RateMyProfessorAPI-1.3.6.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 562b6debd693d2e27ebcc3ec69f1df52f37ea051f023e88d21fb95315d47b7c1 |
|
MD5 | 7eabfa5ac68456dadd58f35e589ad28b |
|
BLAKE2b-256 | dee7f7c86c2c127270f7e526ce6137da5d72ba27442803114b8620a4a6e64e05 |
File details
Details for the file RateMyProfessorAPI-1.3.6-py3-none-any.whl
.
File metadata
- Download URL: RateMyProfessorAPI-1.3.6-py3-none-any.whl
- Upload date:
- Size: 12.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58cc24bdb698ad60553d3d4b9c5026c75ed375e846d8ab22b9202cf037a1d119 |
|
MD5 | a61367d8d0e07ee5f6065a5a314f974c |
|
BLAKE2b-256 | b60a29e032bdc8178a35d3e4b4495c736c2c2e8720188db2eb0484913bd3bee5 |