-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathurls.py
More file actions
52 lines (47 loc) · 1.92 KB
/
urls.py
File metadata and controls
52 lines (47 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# AGH USOS plan URL builder. Per program: "prefix" (grupa_kod prefix) + label -> (grupa_part, term)
BASE = "https://web.usos.agh.edu.pl/kontroler.php?_action=katalog2/przedmioty/pokazPlanGrupyPrzedmiotow"
YEAR = "25/26"
def plan_url(prefix: str, grupa_part: str, term: str = "Z") -> str:
"""Build plan URL from prefix (e.g. 230-TEI), group part (e.g. 1S_sem1) and term (Z or L)."""
cdyd = YEAR.replace("/", "%2F") + "-" + term
return f"{BASE}&grupa_kod={prefix}{grupa_part}&cdyd_kod={cdyd}"
PLANS = {
"teleinfa": {
"prefix": "230-TEI",
"I Stopień, 1 Sem": ("_1S_sem1", "Z"),
"I Stopień, 2 Sem": ("_1S_sem2", "L"),
"I Stopień, 3 Sem": ("_1S_sem3", "Z"),
"I Stopień, 4 Sem": ("_1S_sem4", "L"),
"I Stopień, 5 Sem": ("_1S_sem5", "Z"),
"I Stopień, 6 Sem": ("_1S_sem6", "L"),
"I Stopień, 7 Sem": ("_1S_sem7", "Z"),
"II stopień, 1 Sem": ("_2S_sem1", "L"),
"II stopień, 2 Sem": ("_2S_sem2", "Z"),
"II stopień, 3 Sem": ("_2S_sem3", "L"),
},
"cyberka": {
"prefix": "230-CBZ",
"I Stopień, 1 Sem": ("_1S_sem1", "Z"),
"I Stopień, 2 Sem": ("_1S_sem2", "L"),
"I Stopień, 3 Sem": ("_1S_sem3", "Z"),
"I Stopień, 4 Sem": ("_1S_sem4", "L"),
"I Stopień, 5 Sem": ("_1S_sem5", "Z"),
"I Stopień, 6 Sem": ("_1S_sem6", "L"),
"I Stopień, 7 Sem": ("_1S_sem7", "Z"),
"II stopień, 1 Sem": ("_2S_sem1", "L"),
"II stopień, 2 Sem": ("_2S_sem2", "Z"),
"II stopień, 3 Sem": ("_2S_sem3", "L"),
},
"ntwk": {
"prefix": "230-NTK",
"I Stopień, 4 Sem": ("-1S_sem4", "L"),
"I Stopień, 4 Sem, Ścieżka Chemiczna": ("-1S_sem4_AK", "L"),
}
}
URLS = {
program: {
label: plan_url(data["prefix"], part, term)
for label, (part, term) in (x for x in data.items() if x[0] != "prefix")
}
for program, data in PLANS.items()
}