-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
41 lines (32 loc) · 1.68 KB
/
main.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
# fastapi libraries
from typing import Annotated
from fastapi import FastAPI, Header
# alma-api function libraries
from endpoints.personal_info import personal_info
from endpoints.attendances import attendances
from endpoints.authenticity import authenticity
from endpoints.grades import grades
from endpoints.gpa import gpa
from endpoints.subject import subject
app = FastAPI()
@app.get("/")
def read_root():
return {"alma-api": "v3.0"}
@app.get("/authenticity")
async def read_item(school: Annotated[str, Header()], username: Annotated[str, Header()], password: Annotated[str, Header()]):
return await authenticity(school, username, password)
@app.get("/grades")
async def read_item(school: Annotated[str, Header()], username: Annotated[str, Header()], password: Annotated[str, Header()]):
return await grades(school, username, password)
@app.get("/gpa")
async def read_item(school: Annotated[str, Header()], username: Annotated[str, Header()], password: Annotated[str, Header()]):
return await gpa(school, username, password)
@app.get("/subject")
async def read_item(school: Annotated[str, Header()], username: Annotated[str, Header()], password: Annotated[str, Header()], path: Annotated[str, Header()]):
return await subject(school, username, password, path)
@app.get("/attendances")
async def read_item(school: Annotated[str, Header()], username: Annotated[str, Header()], password: Annotated[str, Header()]):
return await attendances(school, username, password)
@app.get("/personal-info")
async def read_item(school: Annotated[str, Header()], username: Annotated[str, Header()], password: Annotated[str, Header()]):
return await personal_info(school, username, password)