Quickstart Guide¶
Installation¶
First, install the package using pip:
pip install bubt-routinepy
Basic Usage¶
The package provides two main clients:
ScraperClient- Retrieves data by parsing the university’s official website and PDF documents.ApiClient- Uses the university’s internal API (reverse-engineered) for data access.
Initializing Clients¶
# For scraping functionality
from routinepy.lib import ScraperClient
scraper = ScraperClient()
# For API functionality
from routinepy.lib import ApiClient
api = ApiClient()
Common Scenarios¶
1. Getting Class Routines¶
Department-wide routine:
from routinepy.lib.enums import ProgramCode
# Using Scraper or API
dept_routine = await client.get_class_routine(program_code=ProgramCode.CSE_Day)
Faculty-specific routine:
# Using Scraper or API
faculty_routine = await client.get_class_routine(faculty_code="MDI")
Intake-specific routine:
# Using Scraper or API
intake_routine = await client.get_class_routine(
program_code=ProgramCode.CSE_Day,
intake="49"
)
2. Getting Exam Routines¶
Mid or Final term exams:
mid_terms = await api.get_mid_routine(
program_code=ProgramCode.CSE_Day,
intake="50"
)
final_terms = await api.get_final_routine(
program_code=ProgramCode.CSE_Day,
intake="50"
)
Note
Getting Mid/Final term exam routines is only available via API client
Current term exams:
# Using Scraper only
terms = await scraper.get_exam_routine(
program_code=ProgramCode.CSE_Day,
intake="50"
)
Note
The university routine page provides only the current term’s exam routine. There is no dedicated section for Mid/Final term exam.
Important Notes¶
Warning
- Current Limitations of ScraperClient:
ProgramCode.CSE_DAYis the only program currently supported for exam routine.Supplementary routines is not supported due to the complex and inconsistent PDF structure.
Some programs have PDF as the class routine which is not supported.