# akshat2711/academia_scrapper_api_fast architecture

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

- Interactive diagram: https://gitdiagram.com/akshat2711/academia_scrapper_api_fast
- Repository: https://github.com/akshat2711/academia_scrapper_api_fast

## Overview

Academia Fast Scraper API exposes student-data scraping through FastAPI, with an Academia session-based flow and an SRM portal flow. The main workflow authenticates, fetches portal pages, parses student and academic data, and returns a structured response; retries and timetable-derived attendance provide recovery paths. README documents the broader SRM scraper capabilities, while the sampled app excerpt shows a native SRM scraper route. Some retry and fallback wiring is documented but not visible in the sampled app code; those links cite the README.

Main entry points: [`app.py`](https://github.com/akshat2711/academia_scrapper_api_fast/blob/master/app.py) (FastAPI routes), [`studentinfo_scrap.py`](https://github.com/akshat2711/academia_scrapper_api_fast/blob/master/studentinfo_scrap.py) (Academia client), [`tools/native_srm_scraper.py`](https://github.com/akshat2711/academia_scrapper_api_fast/blob/master/tools/native_srm_scraper.py) (Native SRM scraper), [`tools/studentportal_result.py`](https://github.com/akshat2711/academia_scrapper_api_fast/blob/master/tools/studentportal_result.py) (SRM result scraper)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API orchestration"]
  node_app["FastAPI routes<br/>[app.py]"]
end

subgraph group_academia["Academia scraping"]
  node_academia_client["Academia client"]
  node_login_classifier["Login classifier"]
  node_academia_portal{{"Academia portal"}}
end

subgraph group_srm["SRM portal scraping"]
  node_native_scraper["Native SRM scraper"]
  node_result_scraper["SRM result scraper"]
  node_srm_portal{{"SRM student portal"}}
end

subgraph group_recovery["Recovery and parsing"]
  node_html_parser["Academia HTML parser<br/>[parser.py]"]
  node_retry_flow["Fetch retry"]
  node_attendance_fallback["Attendance fallback"]
end

node_client(("API client"))

node_client -->|"submits request"| node_app
node_app -->|"creates client"| node_academia_client
node_academia_client -->|"authenticates and fetches"| node_academia_portal
node_academia_client -->|"classifies login"| node_login_classifier
node_academia_client -->|"parses pages"| node_html_parser
node_app -->|"coordinates retries"| node_retry_flow
node_retry_flow -->|"re-authenticates and fetches"| node_academia_client
node_app -->|"builds fallback"| node_attendance_fallback
node_attendance_fallback -.->|"uses timetable data"| node_html_parser
node_app -->|"routes portal scrape"| node_native_scraper
node_native_scraper -->|"logs in and fetches"| node_srm_portal
node_app -.->|"routes result scrape"| node_result_scraper
node_result_scraper -->|"solves CAPTCHA and fetches"| node_srm_portal

click node_app "https://github.com/akshat2711/academia_scrapper_api_fast/blob/master/app.py"
click node_academia_client "https://github.com/akshat2711/academia_scrapper_api_fast/blob/master/studentinfo_scrap.py"
click node_login_classifier "https://github.com/akshat2711/academia_scrapper_api_fast/blob/master/tools/handle_login_error_codes.py"
click node_html_parser "https://github.com/akshat2711/academia_scrapper_api_fast/blob/master/utils/parser.py"
click node_retry_flow "https://github.com/akshat2711/academia_scrapper_api_fast/blob/master/tools/retry_fetch_failed_login.py"
click node_attendance_fallback "https://github.com/akshat2711/academia_scrapper_api_fast/blob/master/tools/fallback_mock_attendance_data.py"
click node_native_scraper "https://github.com/akshat2711/academia_scrapper_api_fast/blob/master/tools/native_srm_scraper.py"
click node_result_scraper "https://github.com/akshat2711/academia_scrapper_api_fast/blob/master/tools/studentportal_result.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_app,node_client toneBlue
class node_academia_client,node_login_classifier,node_academia_portal toneAmber
class node_native_scraper,node_result_scraper,node_srm_portal toneMint
class node_html_parser,node_retry_flow,node_attendance_fallback toneRose
```

## Components

### API orchestration

- [FastAPI routes](https://github.com/akshat2711/academia_scrapper_api_fast/blob/master/app.py): `app.py`

### Academia scraping

- [Academia client](https://github.com/akshat2711/academia_scrapper_api_fast/blob/master/studentinfo_scrap.py): `studentinfo_scrap.py`
- [Login classifier](https://github.com/akshat2711/academia_scrapper_api_fast/blob/master/tools/handle_login_error_codes.py): `tools/handle_login_error_codes.py`
- **Academia portal**

### SRM portal scraping

- [Native SRM scraper](https://github.com/akshat2711/academia_scrapper_api_fast/blob/master/tools/native_srm_scraper.py): `tools/native_srm_scraper.py`
- [SRM result scraper](https://github.com/akshat2711/academia_scrapper_api_fast/blob/master/tools/studentportal_result.py): `tools/studentportal_result.py`
- **SRM student portal**

### Recovery and parsing

- [Academia HTML parser](https://github.com/akshat2711/academia_scrapper_api_fast/blob/master/utils/parser.py): `utils/parser.py`
- [Fetch retry](https://github.com/akshat2711/academia_scrapper_api_fast/blob/master/tools/retry_fetch_failed_login.py): `tools/retry_fetch_failed_login.py`
- [Attendance fallback](https://github.com/akshat2711/academia_scrapper_api_fast/blob/master/tools/fallback_mock_attendance_data.py): `tools/fallback_mock_attendance_data.py`

### Other components

- **API client**

## Connections

- API client → FastAPI routes: submits request (evidence: `Readme.md`)
- FastAPI routes → Academia client: creates client (evidence: `app.py`)
- Academia client → Academia portal: authenticates and fetches (evidence: `studentinfo_scrap.py`)
- Academia client → Login classifier: classifies login (evidence: `studentinfo_scrap.py`)
- Academia client → Academia HTML parser: parses pages (evidence: `studentinfo_scrap.py`)
- FastAPI routes → Fetch retry: coordinates retries (evidence: `Readme.md`)
- Fetch retry → Academia client: re-authenticates and fetches (evidence: `tools/retry_fetch_failed_login.py`)
- FastAPI routes → Attendance fallback: builds fallback (evidence: `Readme.md`)
- Attendance fallback → Academia HTML parser: uses timetable data
- FastAPI routes → Native SRM scraper: routes portal scrape (evidence: `app.py`)
- Native SRM scraper → SRM student portal: logs in and fetches (evidence: `tools/native_srm_scraper.py`)
- FastAPI routes → SRM result scraper: routes result scrape (evidence: `Readme.md`)
- SRM result scraper → SRM student portal: solves CAPTCHA and fetches (evidence: `tools/studentportal_result.py`)
