Python web scraper to get professor ratings from ratemyprofessor.com website.
Reason this release was yanked:
Version is broken - please use v1.1.2
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
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 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.
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(f"{professor.name} works in the {professor.department} Department of {professor.school.name}.")
print(f"Rating: {professor.rating} / 5.0")
print(f"Difficulty: {professor.difficulty} / 5.0")
print(f"Total Ratings: {professor.num_ratings}")
if professor.would_take_again is not None:
print(f"Would Take Again: {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.1.0.tar.gz
.
File metadata
- Download URL: RateMyProfessorAPI-1.1.0.tar.gz
- Upload date:
- Size: 9.8 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc9577f1a75276f4f2a22a7801ad81b6dd8cb5cf89c206706f1685dc44a2284c |
|
MD5 | 50ba1939d5dea26513aa8cc25f10323f |
|
BLAKE2b-256 | 2b2b0bf307bf01ac35c1b9de03fcb1caf79aef791622211668c487d9c46624ba |
File details
Details for the file RateMyProfessorAPI-1.1.0-py2.py3-none-any.whl
.
File metadata
- Download URL: RateMyProfessorAPI-1.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 10.5 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ecc1e0ee78c370c97df9255bcb13263c239e0c62ab5d070bc8b6c952abf9989 |
|
MD5 | da4c5acf504ec8faff76940ba2ba8057 |
|
BLAKE2b-256 | 8c6aeb78cafc36ce5cfd7b9e6b9565c3db96453d2ac4971a179a0437e5b2c2bf |