TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Andr21Da16/UNITRU-ACADEMIC/llms.txt
Use this file to discover all available pages before exploring further.
backend/scripts/ directory contains five utility scripts for development, debugging, and catalog management. They are development tools — none of them run as part of the production backend. All scripts that interact with the live SUV portal operate against the real university system, so never hardcode credentials in these files.
inspect_suv_login.py
Verifies the current CSS selectors and DOM structure of the SUV login form. Run this script whenever the SUV portal is updated and login stops working — it opens the login page in a headless Chromium browser and prints everyinput, button, image, and form element it finds, along with their id, name, type, class, and src attributes.
The output lets you cross-check the selectors used in SuvAuthenticator against what the portal actually exposes, without needing a visible browser.
No arguments required.
test_full_dashboard.py
Runs a full end-to-end test against the live SUV: authenticates with the provided credentials (retrying the full authentication flow globally up to 5 times, with up to 3 CAPTCHA attempts per try), then extracts all data modules — profile, academic record, enrollment, attendance, grades, schedule, and optimized schedule options — and prints the complete JSON-like result to stdout. Use this script to confirm that all extractors and navigators are working correctly after a SUV update, or to reproduce a bug reported by a user. Arguments:<username> <password>
download_horarios.py
Downloads the official schedule catalog from a Google Sheets spreadsheet and saves it locally. It fetches the workbook as XLSX (to preserve merged cells needed for block-duration parsing) and also downloads each sheet individually as CSV. The spreadsheet must be shared with “anyone with the link” access. Arguments:<google_sheets_url> (full URL or spreadsheet ID). Optionally, a second argument specifies the output directory (default: data/horarios_csv/).
parse_horarios.py
Converts the downloadedhorarios.xlsx file into the structured data/horarios_catalogo.json catalog that the backend’s JsonCatalogAdapter and ScheduleOptimizer consume. Each worksheet in the workbook represents one cycle + section (e.g. “Ciclo III - B”). The parser extracts metadata (cycle, group, section, semester), the course list (teacher, theory/practice/lab hours), and all timetable sessions (day, start time, end time, room, subgroup, session type).
Block durations spanning multiple rows are recovered from the XLSX mergeCells ranges, since CSV exports lose that information.
No arguments required (defaults to data/horarios_csv/horarios.xlsx → data/horarios_catalogo.json). Optional positional arguments override the input and output paths.
test_optimizer.py
Tests the schedule optimizer (OptimizeScheduleUseCase) using course names as input. It loads the local data/horarios_catalogo.json, searches for sections matching the given course names, generates all conflict-free combinations, and prints the top 3 ranked options with their score, number of days, free time between sessions, and extreme-hour sessions.
If no arguments are provided, it runs against a built-in set of three default courses (Ciclo III sample) and then against a full six-course Ciclo III load.
Arguments: course names as positional arguments (use quotes for names with spaces).
missing list. Re-run download_horarios.py and parse_horarios.py to refresh the catalog if courses are missing.
Catalog update workflow
The catalog is baked into the backend Docker image during
docker build. Updating data/horarios_catalogo.json on disk only takes effect after the backend image is rebuilt and redeployed.Download the new spreadsheet
Run
download_horarios.py with the Google Sheets URL provided by the university for the new semester. This saves horarios.xlsx and per-sheet CSVs to data/horarios_csv/.Parse into JSON
Run
parse_horarios.py to convert the XLSX to data/horarios_catalogo.json. Verify the printed section count and spot-check a few sessions in the output.