data models
Typed wrappers around portal JSON. Attendance: Attendance models. Exams: Exam models. Registration: Registration models. Captcha: Tokens and captcha.
Many methods still return raw dict (get_attendance, get_exam_schedule, grade card, fees). Models exist where the wrapper bothers to parse.
flowchart TB
subgraph attendance [attendance.py]
AH["AttendanceHeader"]
Sem["Semester"]
AM["AttendanceMeta"]
end
subgraph exam [exam.py]
EE["ExamEvent"]
end
subgraph registration [registration.py]
RS["RegisteredSubject"]
Reg["Registrations"]
end
subgraph tokens [tokens.py]
Cap["Captcha"]
end
AM --> AH
AM --> Sem
Reg --> RSFactories#
Every dataclass except AttendanceMeta and Registrations has from_json(resp: dict). Those two take the full response object in __init__ and map child lists.
flowchart LR JSON["resp['response']"] --> Model["from_json or __init__"] Model --> Obj["typed object"]
Where they show up#
| Model | Produced by |
|---|---|
Captcha |
get_captcha, Captcha.from_json |
WebportalSession |
student_login (not a dataclass) |
AttendanceMeta |
get_attendance_meta |
AttendanceHeader, Semester |
inside AttendanceMeta; Semester also from several semester-list methods |
Registrations / RegisteredSubject |
get_registered_subjects_and_faculties |
ExamEvent |
get_exam_events |
Semester is defined in attendance.py even when used for exams, marks, and grade cards.
Field mapping style#
Portal keys are lowercase mashed words (registrationid, employeename, exameventid). Python attributes use underscores (registration_id, employee_name, exam_event_id). from_json is the only translation layer.
classDiagram
class AttendanceMeta {
headers
semesters
latest_header()
latest_semester()
}
class Registrations {
total_credits
subjects
}
class ExamEvent {
exam_event_id
registration_id
}
class Captcha {
captcha
hidden
image
payload()
}What is not modeled#
Bank info, fee summary, fines, attendance detail rows, exam schedule, grade card, SGPA/CGPA, subject choices. Those stay as the portal’s dicts, typos included (LTpercantage, registationid on the way out).