fix(Container): moved into apporpriate folders

This commit is contained in:
2024-12-14 16:04:17 -07:00
parent 99bfecce23
commit 2cca4777de
35 changed files with 38 additions and 12 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -0,0 +1,44 @@
import pandas as pd
import yaml
# Load the YAML file
with open("./interview_database.yaml", 'r') as file:
interview_data = yaml.safe_load(file)
# Access the nested structure within 'Data'
flattened_data = []
for date, date_info in interview_data['Data'].items():
meeting_duration = date_info.get('Meeting Duration')
for start_time_info in date_info.get('Meeting Start Times', []):
for start_time, meeting_info in start_time_info.items():
interviewer_name = meeting_info['Interviewer'][0].get('Name')
interviewer_email = meeting_info['Interviewer'][1].get('Email')
interviewee_name = meeting_info['Interviewee'][0].get('Name')
interviewee_email = meeting_info['Interviewee'][1].get('Email')
category = meeting_info.get('Category')
status = meeting_info.get('Status')
slot = meeting_info.get('Slot')
# Add flattened row to list
flattened_data.append({
'Date': date,
'Meeting Duration': meeting_duration,
'Start Time': start_time,
'Interviewer Name': interviewer_name,
'Interviewer Email': interviewer_email,
'Interviewee Name': interviewee_name,
'Interviewee Email': interviewee_email,
'Category': category,
'Status': status,
'Slot': slot
})
# Convert to DataFrame if flattened data is not empty
if flattened_data:
df = pd.DataFrame(flattened_data)
# Write the DataFrame to an Excel file
df.to_excel("interview_database.xlsx", index=False)
print("Data has been written to interview_database.xlsx")
else:
print("No data found to write.")

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

1
Other Items/README.md Normal file
View File

@ -0,0 +1 @@
# Interview-Backend

View File

@ -0,0 +1,11 @@
from WriteDB import AppendAppointment
def TestBookAppointment():
date_1 = "2024-09-16"
start_time_1 = "10:30:00"
interviewee_name_1 = "Alice Johnson"
interviewee_email_1 = "ahmadmuhammadofficial@gmail.com"
print(f"\nTest Case 1: Trying to book {date_1} at {start_time_1} for {interviewee_name_1} ({interviewee_email_1})")
AppendAppointment(date_1, start_time_1, interviewee_name_1, interviewee_email_1)
TestBookAppointment()

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -0,0 +1,64 @@
Data:
September 16:
Meeting Duration: 30 min
Meeting Start Times:
- 10:00 AM:
Interviewer:
- Name: John
- Email: john@example.com
Interviewee:
- Name: Jane
- Email: jane@example.com
Category: PowerDrive
Status: Done
Slot: 2
- 10:30 AM:
Interviewer:
- Name: Jay
- Email: jay@example.com
Interviewee:
- Name: Zoz
- Email: Zoz@example.com
Category: PowerTrain
Status: Pending
Slot: 3
- 11:00 AM:
Interviewer:
- Name: Ali
- Email: Ali@example.com
Interviewee:
- Name: Bob
- Email: Bob@example.com
Category: Software
Status: Rescheduled
Slot: 1
- 11:30 AM:
Interviewer:
- Name:
- Email:
Interviewee:
- Name:
- Email:
Category:
Status:
Slot: 1
- 12:00 PM:
Interviewer:
- Name: Ali, John
- Email: Ali@example.com, Jhon@example.com
Interviewee:
- Name: Bob
- Email: Bob@example.com
Category: Software
Status: Cancelled
Slot: 1
- 12:30 PM:
Interviewer:
- Name: Ali
- Email: Ali@example.com
Interviewee:
- Name: Bob, Jish
- Email: Bob@example.com, jish@example.com
Category: Software
Status: Cancelled
Slot: 2

25
Other Items/testhttp.py Normal file
View File

@ -0,0 +1,25 @@
import json
import requests
import timeit
def BenchMarkServer():
rawRes = requests.get("http://localhost:8080/getAppointments")
res = json.loads(rawRes.text)
#print(json.dumps(res, indent=1))
def BenchMarkDjango():
rawRes = requests.get("http://127.0.0.1:8000/getAppointments")
res = json.loads(rawRes.text)
#print(json.dumps(res, indent=1))
if __name__ == "__main__":
test = 1
if test:
djangoTime = timeit.timeit(stmt=BenchMarkDjango, number=1000)
# pythonTime = timeit.timeit(stmt=BenchMarkServer, number=10)
print(f"FastAPI: {djangoTime}\nPython: ")
reqbody = {
"body": {"message": "hello"}
}
# rawRes = requests.post("http://localhost:8000/SelectInterview", reqbody)

29
Other Items/web1.html Normal file
View File

@ -0,0 +1,29 @@
<html lang="en-US">
<head>
<title>Interview Invitation</title>
</head>
<body>
<p>Dear {interviewee_name},</p>
<p>Your interview has been scheduled on {date} at {start_time}</p>
<p>Please ensure to be available at the designated time.</p>
<a
href="https://calendar.google.com/calendar/render?action=TEMPLATE&text=Interview+with+{interviewee_name}&dates=20241130T100000Z/20241130T110000Z&details=Interview+with+UCalgary+Baja+Team&location=ENC37"
target="_blank"
>
<button type="button" class="AddtoCal">Add to Google Calendar</button>
</a>
<a
href="https://outlook.live.com/calendar/0/deeplink/compose?subject=Interview+with+{interviewee_name}&body=Interview+with+UCalgary+Baja+Team&location=ENC37&startdt=2024-11-30T10:00:00&enddt=2024-11-30T11:00:00"
target="_blank"
>
<button type="button" class="AddtoCal">Add to Outlook Calendar</button>
</a>
<p>Best regards,</p>
<p>UCalgary Baja Interview Team</p>
<img
src="https://res.cloudinary.com/dpgrgsh7g/image/upload/v1733003224/UCalgaryBAJA_Logo-2024_mpmljh.png"
alt="UCalgary Baja Team"
height="120svh"
/>
</body>
</html>