diff --git a/NoSheet.py b/NoSheet.py new file mode 100644 index 0000000..3d216f1 --- /dev/null +++ b/NoSheet.py @@ -0,0 +1,35 @@ +import openpyxl +import yaml +import json + +yamlraw = """ + Interview TimeTable: + - Date: Null + - Meeting Duration: 30 min + - Start Time Slot: Null + - Interviewee Name: Null + - Interviewee Email: Null + - Category (if not general): Null + - Interviewer(s) Name(s): Null + - Status: Dropdown (Options in datahelp) + Recruitment Responses: + - Frist Name (What we should call them): Null + - Last Name: Null + - Ucalgary Email: Null + - What Subsystem/SubTeam are you interested in?: Null + - Major: Null + - Academic Year: Null + - Why are you interested in joining UCalgary BAJA?: Null + - Where did you hear about us?: Null + - Are you available for team meetings/work days? Saturdays 10 am - 4 pm: Null #add condiftional formatting for no to make whole line red + Data Help: + - Status Dropdown: + - Unknown + - Done + - No Show + - Cancelled/Moved + """ + +yamlsheet = yaml.safe_load(yamlraw) + +print(json.dumps(yamlsheet, indent=4)) \ No newline at end of file diff --git a/OR-L-Interview Data.xlsx b/OR-L-Interview Data.xlsx new file mode 100644 index 0000000..d44d9a8 Binary files /dev/null and b/OR-L-Interview Data.xlsx differ diff --git a/ReadDB.py b/ReadDB.py index b1194d5..31d227b 100644 --- a/ReadDB.py +++ b/ReadDB.py @@ -4,12 +4,12 @@ from filelock import FileLock, Timeout import time # Define the path to the Excel file and the lock file -excel_file_path = "./interview_database.xlsx" -lock_file_path = "./interview_database.xlsx.lock" +excel_file_path = "./OR-L-Interview Data.xlsx" +lock_file_path = "./OR-L-Interview Data.xlsx.lock" def ReadDatabase(): """ - Reads the Database + Reads the database for which slots are available ``REQUIRES``: None diff --git a/WriteDB.py b/WriteDB.py index cf9ad46..9c64757 100644 --- a/WriteDB.py +++ b/WriteDB.py @@ -70,7 +70,7 @@ def AppendAppointment(date, start_time, interviewee_name, interviewee_email): with FileLock(lock_path): # Ensure process-safe access to the file # Load workbook and select "Sheet1" for updating appointments workbook = load_workbook(file_path) - sheet = workbook["Sheet1"] + sheet = workbook["Interview Timetable"] df = pd.read_excel(file_path) # Find and update the row that matches the provided date and start time diff --git a/emp.yml b/emp.yml new file mode 100644 index 0000000..2a49ad1 --- /dev/null +++ b/emp.yml @@ -0,0 +1,25 @@ +Interview TimeTable: + - Date: Null + - Meeting Duration: 30 min + - Start Time Slot: Null + - Interviewee Name: Null + - Interviewee Email: Null + - Category (if not general): Null + - Interviewer(s) Name(s): Null + - Status: Dropdown (Options in datahelp) +Recruitment Responses: + - Frist Name (What we should call them): Null + - Last Name: Null + - Ucalgary Email: Null + - What Subsystem/SubTeam are you interested in?: Null + - Major: Null + - Academic Year: Null + - Why are you interested in joining UCalgary BAJA?: Null + - Where did you hear about us?: Null + - Are you available for team meetings/work days? Saturdays 10 am - 4 pm: Null #add condiftional formatting for no to make whole line red +Data Help: + - Status Dropdown: + - Unknown + - Done + - No Show + - Cancelled/Moved diff --git a/interview_database.xlsx b/interview_database.xlsx deleted file mode 100644 index 69e0caf..0000000 Binary files a/interview_database.xlsx and /dev/null differ diff --git a/main.py b/main.py index 07a7486..f052938 100644 --- a/main.py +++ b/main.py @@ -7,7 +7,20 @@ app = FastAPI() @app.get("/") def get_root(): - res = {"message": "Hello World"} + """ + This does nothing, allows for pings to check for life + + ``REQUIRES``: ```None`` Nothing + + ``PROMISES``: ``JSON`` returns a short message in the body + + ``Develop in part by``: Brock + + ``Contact``: darkicewolf50@gmail.com + + """ + + res = {"message": "Hello I am alive, this does nothing"} # Return the response with the custom header return JSONResponse( @@ -15,22 +28,29 @@ def get_root(): "isBase64Encoded": "false", # Header Modification }, content={ - "body": res + "body": res # Ensure res is a dict or do json.dumps to enusre it is stringified }, # status_code=200 commented out just to show how to change it if you wanted ) - # # Set headers - # headers = { - # "isBase64Encoded": "false", # Header Modification - # } - from GetSchedulePackager import getSchedulePackager @app.get("/getAppointments") async def getAppointments(): + """ + checks for all available slots in the database + + ``REQUIRES``: ```None`` Nothing + + ``PROMISES``: ``JSON`` returns all of the avaialbe slots by date then time + + ``Develop in part by``: Brock + + ``Contact``: darkicewolf50@gmail.com + + """ res = getSchedulePackager() @@ -39,7 +59,7 @@ async def getAppointments(): "isBase64Encoded": "false", # Header Modification }, content={ - "body": res + "body": res # Ensure res is a dict or do json.dumps to enusre it is stringified }, # status_code=200 commented out just to show how to change it if you wanted @@ -48,6 +68,18 @@ async def getAppointments(): from postSelectAppointment import SelectAppointment class Appointment(BaseModel): + """ + The formatted + + ``REQUIRES``: Correct Format + + ``PROMISES``: Formatted class, needs to be converted into dict os that it can be used in another file + + ``Develop in part by``: Brock + + ``Contact``: darkicewolf50@gmail.com + + """ intervieweeName: str date: str startTime: str @@ -56,6 +88,18 @@ class Appointment(BaseModel): @app.post("/SelectInterview") async def postSelectInterview(rawRequest: Appointment): + """ + Books an interview, first checks if the slot is valid + + ``REQUIRES``: ```Appointment`` A specifically formatted request + + ``PROMISES``: ``JSON`` returns if the booking was successful or not + + ``Develop in part by``: Brock + + ``Contact``: darkicewolf50@gmail.com + + """ requestDict = {key: str(value) for key, value in rawRequest.dict().items()} res = SelectAppointment(requestDict) @@ -65,7 +109,7 @@ async def postSelectInterview(rawRequest: Appointment): "isBase64Encoded": "false", # Header Modification }, content={ - "body": res + "body": res # Ensure res is a dict or do json.dumps to enusre it is stringified }, # status_code=200 commented out just to show how to change it if you wanted