# tisuela/ratemyprof-api architecture

> Architecture diagram of the GitHub repository tisuela/ratemyprof-api, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tisuela/ratemyprof-api
- Repository: https://github.com/tisuela/ratemyprof-api

## Overview

This Python package provides a client for retrieving Rate My Professors data for a university, representing professors, searching for them, fetching reviews, and exporting data to CSV. The main workflow is to initialize the client with a university ID, retrieve professor listings, then search or fetch reviews and optionally write results to files. The README also describes printing professor details. Search/detail implementation is incomplete or inconsistent in the sampled source, so those capabilities are shown without asserting unsupported internal calls.

Main entry points: [`ratemyprof_api/ratemyprof_api.py`](https://github.com/tisuela/ratemyprof-api/blob/master/ratemyprof_api/ratemyprof_api.py) (University client), [`ratemyprof_api/professor.py`](https://github.com/tisuela/ratemyprof-api/blob/master/ratemyprof_api/professor.py) (Professor record)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client operations"]
  node_api["University client<br/>[ratemyprof_api.py]"]
  node_listing["Professor listings<br/>[ratemyprof_api.py]"]
  node_search["Professor search<br/>[ratemyprof_api.py]"]
  node_detail["Professor details<br/>[ratemyprof_api.py]"]
  node_reviews["Review retrieval<br/>[ratemyprof_api.py]"]
  node_export["CSV export<br/>[ratemyprof_api.py]"]
end

subgraph group_records["Professor data"]
  node_professor["Professor record<br/>[professor.py]"]
end

subgraph group_io["External data and files"]
  node_rmp["Rate My Professors"]
  node_files[("Local CSV files")]
end

node_user(("User"))

node_user -->|"initializes"| node_api
node_api -->|"loads listings"| node_listing
node_listing -->|"requests pages"| node_rmp
node_listing -->|"creates records"| node_professor
node_user -->|"searches by name"| node_search
node_user -->|"requests detail"| node_detail
node_user -.->|"requests reviews"| node_reviews
node_reviews -->|"requests pages"| node_rmp
node_user -.->|"exports data"| node_export
node_export -->|"writes CSV"| node_files
node_api -->|"creates directory"| node_files

click node_api "https://github.com/tisuela/ratemyprof-api/blob/master/ratemyprof_api/ratemyprof_api.py"
click node_listing "https://github.com/tisuela/ratemyprof-api/blob/master/ratemyprof_api/ratemyprof_api.py"
click node_search "https://github.com/tisuela/ratemyprof-api/blob/master/ratemyprof_api/ratemyprof_api.py"
click node_detail "https://github.com/tisuela/ratemyprof-api/blob/master/ratemyprof_api/ratemyprof_api.py"
click node_reviews "https://github.com/tisuela/ratemyprof-api/blob/master/ratemyprof_api/ratemyprof_api.py"
click node_export "https://github.com/tisuela/ratemyprof-api/blob/master/ratemyprof_api/ratemyprof_api.py"
click node_professor "https://github.com/tisuela/ratemyprof-api/blob/master/ratemyprof_api/professor.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_api,node_listing,node_search,node_detail,node_reviews,node_export,node_user toneBlue
class node_professor toneAmber
class node_rmp,node_files toneMint
```

## Components

### Client operations

- [University client](https://github.com/tisuela/ratemyprof-api/blob/master/ratemyprof_api/ratemyprof_api.py): `ratemyprof_api/ratemyprof_api.py`
- [Professor listings](https://github.com/tisuela/ratemyprof-api/blob/master/ratemyprof_api/ratemyprof_api.py): `ratemyprof_api/ratemyprof_api.py`
- [Professor search](https://github.com/tisuela/ratemyprof-api/blob/master/ratemyprof_api/ratemyprof_api.py): `ratemyprof_api/ratemyprof_api.py`
- [Professor details](https://github.com/tisuela/ratemyprof-api/blob/master/ratemyprof_api/ratemyprof_api.py): `ratemyprof_api/ratemyprof_api.py`
- [Review retrieval](https://github.com/tisuela/ratemyprof-api/blob/master/ratemyprof_api/ratemyprof_api.py): `ratemyprof_api/ratemyprof_api.py`
- [CSV export](https://github.com/tisuela/ratemyprof-api/blob/master/ratemyprof_api/ratemyprof_api.py): `ratemyprof_api/ratemyprof_api.py`

### Professor data

- [Professor record](https://github.com/tisuela/ratemyprof-api/blob/master/ratemyprof_api/professor.py): `ratemyprof_api/professor.py`

### External data and files

- **Rate My Professors**
- **Local CSV files**

### Other components

- **User**

## Connections

- User → University client: initializes (evidence: `README.md`)
- University client → Professor listings: loads listings (evidence: `ratemyprof_api/ratemyprof_api.py`)
- Professor listings → Rate My Professors: requests pages (evidence: `ratemyprof_api/ratemyprof_api.py`)
- Professor listings → Professor record: creates records (evidence: `ratemyprof_api/ratemyprof_api.py`)
- User → Professor search: searches by name (evidence: `README.md`)
- User → Professor details: requests detail (evidence: `README.md`)
- User → Review retrieval: requests reviews
- Review retrieval → Rate My Professors: requests pages (evidence: `ratemyprof_api/ratemyprof_api.py`)
- User → CSV export: exports data
- CSV export → Local CSV files: writes CSV (evidence: `ratemyprof_api/ratemyprof_api.py`)
- University client → Local CSV files: creates directory (evidence: `ratemyprof_api/ratemyprof_api.py`)
