-
Notifications
You must be signed in to change notification settings - Fork 0
/
output_json.py
65 lines (43 loc) · 1.14 KB
/
output_json.py
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
53
54
55
56
57
58
59
60
61
62
63
64
65
from typing import List, Literal, Optional, TypedDict
class Requisite(TypedDict):
source_id: int
target_id: int
type: Literal["prereq", "coreq", "strict-coreq"]
class Item(TypedDict):
name: str
id: int
credits: float
curriculum_requisites: List[Requisite]
class Term(TypedDict):
id: int
curriculum_items: List[Item]
class Curriculum(TypedDict):
curriculum_terms: List[Term]
class CurriculumJson(TypedDict):
curriculum: Curriculum
class DegreePlan(TypedDict):
id: int
class DegreePlanJson(TypedDict):
curriculum: Curriculum
degree_plan: DegreePlan
class Course(TypedDict):
id: int
name: str
prefix: Optional[str]
num: Optional[str]
credits: float
requisites: List[Requisite]
nameCanonical: Optional[str]
nameSub: Optional[str]
annotation: Optional[str]
class CurriculumHash(TypedDict):
courses: List[Course]
name: str
system_type: Literal["quarter", "semester"]
class TermHash(TypedDict):
id: int
name: str
items: List[Course]
class DegreePlanHash(TypedDict):
terms: List[TermHash]
system_type: Literal["quarter", "semester"]