Skip to main content

A Python API Client for RateMyProfessors.

Project description

RateMyProfessors API Client

Typed, retrying, rate-limited unofficial client for RateMyProfessors, with optional helpers for ingestion workflows (sentiment, dedupe, course-code normalization).

Note: This library is unofficial and may break if RMP changes their internal API. This library has been made open-source so that if/when there are any changes, someone is able to take note of these changes and help to contribute an update.

Installation

pip install ratemyprofessors-client

With optional sentiment extras (TextBlob):

pip install 'ratemyprofessors-client[sentiment]'

Quickstart

from rmp_client import RMPClient

SCHOOL_ID = 1466  # example: Queen's University ID on RMP

with RMPClient() as client:
    for prof in client.iter_professors_for_school(SCHOOL_ID, page_size=20):
        print(prof.name, prof.overall_rating, prof.num_ratings)

Fetch details and iterate ratings incrementally:

from datetime import date
from rmp_client import RMPClient

with RMPClient() as client:
    professor = client.get_professor("PROFESSOR_ID")

    for rating in client.iter_professor_ratings(professor.id, since=date(2024, 1, 1)):
        print(rating.date, rating.quality, rating.comment)

Extras

Optional helpers live under rmp_client.extras:

  • rmp_client.extras.sentiment.analyze_sentiment
  • rmp_client.extras.dedupe.normalize_comment / is_valid_comment
  • rmp_client.extras.course_codes.build_course_mapping

See docs/ and examples/ for more. This repo also includes an examples/ingest_supabase.py script that mirrors a Supabase-centric scraping pipeline using this client.

Publishing to PyPI

This project follows the Python Packaging User Guide and uses PyPI Trusted Publishing with GitHub Actions.

  1. One-time setup: On pypi.org add a trusted publisher for this repo (workflow publish-to-pypi.yml, environment pypi). Create a pypi environment in the repo and enable “Required reviewers” for production releases.
  2. Release: Create and push a tag (e.g. v0.1.0). The workflow builds both a wheel and an sdist and publishes to PyPI. Any push builds and publishes to TestPyPI (use the testpypi environment).

Local build (no publish):

pip install build
python -m build
# Outputs in dist/: .whl (wheel) and .tar.gz (sdist)

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

ratemyprofessors_client-0.1.0.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ratemyprofessors_client-0.1.0-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file ratemyprofessors_client-0.1.0.tar.gz.

File metadata

  • Download URL: ratemyprofessors_client-0.1.0.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ratemyprofessors_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 12a4d14c94fcea4d16cc5e40d4f2732c8644d72c304f7082b5fe79ba11c99007
MD5 0075c2f0a1ff3e9002e32d7fc0a2a127
BLAKE2b-256 7491a17b106af10c0f71504eab62a30bee60894b5207fdd09fc8d32c8eddb76b

See more details on using hashes here.

Provenance

The following attestation bundles were made for ratemyprofessors_client-0.1.0.tar.gz:

Publisher: publish-to-pypi.yml on amaanjaved1/Rate-My-Professors-API-Client-Python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ratemyprofessors_client-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ratemyprofessors_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c7a78d9b66677f7a1051765076e1cfa72c6441aec1e909a3900a4e2d250aec83
MD5 7c622d1c8a74813dac7cbb6764afb418
BLAKE2b-256 59b214c9e1226101aeb0d9c99d28599623d20348ba268258d856f80767978d75

See more details on using hashes here.

Provenance

The following attestation bundles were made for ratemyprofessors_client-0.1.0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on amaanjaved1/Rate-My-Professors-API-Client-Python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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