Skip to content

v2.0.0 - Major Rework

Choose a tag to compare

@amaanjaved1 amaanjaved1 released this 18 Mar 03:11
· 19 commits to main since this release

v2.0.0 — Pure GraphQL

v2 is a complete rewrite of how the client talks to RateMyProfessors. The public API (method names, return types) is largely the same, but the internals are fundamentally different.

Replaced HTML scraping with direct GraphQL

In v1, every request worked by fetching an RMP HTML page, parsing out the embedded window.__RELAY_STORE__ JSON blob, and walking the Relay graph to resolve __ref pointers. This was fragile — any change to RMP's page structure or Relay store shape could break the client.

v2 sends GraphQL POST requests directly to https://www.ratemyprofessors.com/graphql, using the same operation names and fragment names the RMP frontend uses. This is simpler, faster, and far less likely to break.

  • Deleted relay_store.py (~516 lines of Relay store graph traversal)
  • Deleted test_relay_store.py (~312 lines of tests for the above)
  • Added queries.py — all GraphQL query strings in one place
  • Rewrote client.py from ~1,288 lines down to ~774 lines

Simplified configuration

Removed the page-URL config fields. The only URL config is now base_url (the GraphQL endpoint).

Simplified HTTP client

Removed the get_html() method. The client no longer fetches HTML pages at all — only post_json() for GraphQL requests.

Consolidated redundant queries

GET_TEACHER_QUERY and GET_SCHOOL_QUERY have been removed. get_professor() and get_school() now reuse the ratings list queries with a minimal page size, returning the same data in fewer round trips.

Documentation

  • Updated README with full API reference
  • Updated all docstrings throughout source files
  • Updated MkDocs documentation

Testing

  • All tests now run against the live RMP GraphQL API
  • Removed relay store tests and extras tests

Migration from v1

The public method signatures are unchanged: search_schools, search_professors, get_professor, get_school, get_professor_ratings_page, get_school_ratings_page, iterators, and raw_query all work the same way. No code changes needed for the core API. The only breaking changes are:

  • The page-URL config fields are removed from RMPClientConfig
  • relay_store module is removed (was not part of the public API)