diff --git a/GetSchedulePackager.py b/GetSchedulePackager.py index 4bfab74..975953a 100644 --- a/GetSchedulePackager.py +++ b/GetSchedulePackager.py @@ -5,7 +5,21 @@ with open("./MockDB/schedule.yaml", "r") as scheduleyml: ymlschedule = yaml.safe_load(scheduleyml) def getSchedulePackager(): - res = {"isBase64ENcoded": "false", + """ + What function does + + ``REQUIRES``: None + + ``PROMISES``: What function returns if applicable + + ``Develop in part by``: Brock T + + ``Contact``: darkicewolf50@gmail.ocm + + """ + res = { + "isBase64ENcoded": "false", "statusCode": 200, - "body": ymlschedule} - return res + "body": ymlschedule + } + return json.dumps(res) diff --git a/ReadDB.py b/ReadDB.py deleted file mode 100644 index 168c2c4..0000000 --- a/ReadDB.py +++ /dev/null @@ -1,26 +0,0 @@ -import pandas as pd - -def ReadDatabase(): - # Load the updated Excel file into a pandas DataFrame - excel_file_path = "./interview_database.xlsx" - df = pd.read_excel(excel_file_path) - - # Initialize the dictionary to store the structured data - interview_data = {} - - # Group the DataFrame by Date, Start Time, and Slot for organization - for _, row in df.iterrows(): - date = row['Date'] - start_time = row['Start Time'] - slot = int(row['Slot']) if not pd.isna(row['Slot']) else 0 - - # Initialize nested structure if not present - if date not in interview_data: - interview_data[date] = {} - if start_time not in interview_data[date]: - if len(str(row['Interviewee Name']).split()) != slot: - interview_data[date][start_time] = { - 'Meeting Duration': row['Meeting Duration'], - } - # Print the structured dictionary in JSON format for readability - return interview_data \ No newline at end of file diff --git a/__pycache__/GetSchedulePackager.cpython-313.pyc b/__pycache__/GetSchedulePackager.cpython-313.pyc index a9614be..cb1c364 100644 Binary files a/__pycache__/GetSchedulePackager.cpython-313.pyc and b/__pycache__/GetSchedulePackager.cpython-313.pyc differ diff --git a/__pycache__/postSelectAppointment.cpython-313.pyc b/__pycache__/postSelectAppointment.cpython-313.pyc index 987acf7..7991e9f 100644 Binary files a/__pycache__/postSelectAppointment.cpython-313.pyc and b/__pycache__/postSelectAppointment.cpython-313.pyc differ diff --git a/interview_database.xlsx b/interview_database.xlsx deleted file mode 100644 index ed722d9..0000000 Binary files a/interview_database.xlsx and /dev/null differ diff --git a/main.py b/main.py index ec0918e..c6508fe 100644 --- a/main.py +++ b/main.py @@ -3,6 +3,5 @@ from postSelectAppointment import SelectAppointment import json if __name__ == "__main__": - print("hello") - print(json.dumps(getSchedulePackager(), indent=4)) - print(json.dumps(SelectAppointment("10:00 am"), indent=4)) \ No newline at end of file + print(getSchedulePackager()) + print(SelectAppointment("10:00 am")) \ No newline at end of file diff --git a/postSelectAppointment.py b/postSelectAppointment.py index be28849..81010d7 100644 --- a/postSelectAppointment.py +++ b/postSelectAppointment.py @@ -1,6 +1,21 @@ +import json +import datetime +def SelectAppointment (appointmentTime:datetime): + """ + packages up a response for a http request + + ``appointmentTime``: ``timedate`` + The appointment date and time details + + ``returns``: ``json`` + Returns the status of the booking confirmation + + ``Develop in part by``: Brock T + + ``Contact``: darkicewolf50@gmail.com + """ -def SelectAppointment (appointmentTime): status = mockWriteFunction(appointmentTime) res = {"isBase64ENcoded": "false", "statusCode": 200, @@ -9,7 +24,7 @@ def SelectAppointment (appointmentTime): res["body"] = {"Success": True} else: res["body"] = {"Success": False} - return res + return json.dumps(res)