initial project

This commit is contained in:
Talhadeveloperr
2026-09-09 17:00:54 +05:00
commit a7bb2f3dae
72 changed files with 1051 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
batch_code,department,program,session
25021519,CS,BSCS,25
25021520,CS,BSSE,25
25031519,EE,BSEE,25
1 batch_code department program session
2 25021519 CS BSCS 25
3 25021520 CS BSSE 25
4 25031519 EE BSEE 25

View File

@@ -0,0 +1,4 @@
batch_code,department,program,session
26021519,CS,BSCS,26
26021520,CS,BSSE,26
26031519,EE,BSEE,26
1 batch_code department program session
2 26021519 CS BSCS 26
3 26021520 CS BSSE 26
4 26031519 EE BSEE 26

View File

@@ -0,0 +1,2 @@
block_id,block_name
A,Block A
1 block_id block_name
2 A Block A

View File

@@ -0,0 +1,7 @@
room_id,room_name,block_id,room_type,capacity
A-101,Room 101,A,classroom,60
A-102,Room 102,A,classroom,60
A-103,Room 103,A,classroom,50
A-201,Room 201,A,classroom,60
A-L01,Computer Lab 1,A,lab,35
A-L02,Computer Lab 2,A,lab,35
1 room_id room_name block_id room_type capacity
2 A-101 Room 101 A classroom 60
3 A-102 Room 102 A classroom 60
4 A-103 Room 103 A classroom 50
5 A-201 Room 201 A classroom 60
6 A-L01 Computer Lab 1 A lab 35
7 A-L02 Computer Lab 2 A lab 35

View File

@@ -0,0 +1,25 @@
course_id,batch_code,instructor_code
CS101,25021519,1001
CS102,25021519,1001
CS201,25021519,1002
CS202,25021519,1002
CS101,25021520,1001
CS102,25021520,1001
CS201,25021520,1002
CS202,25021520,1002
EE101,25031519,1004
EE102,25031519,1004
CS101,26021519,1001
CS102,26021519,1001
CS201,26021519,1002
CS202,26021519,1002
CS101,26021520,1001
CS102,26021520,1001
CS201,26021520,1002
CS202,26021520,1002
EE101,26031519,1004
EE102,26031519,1004
GEN101,25021519|25021520|25031519,1002
GEN102,25021519|25021520|25031519,1006
GEN101,26021519|26021520|26031519,1002
GEN102,26021519|26021520|26031519,1006
1 course_id batch_code instructor_code
2 CS101 25021519 1001
3 CS102 25021519 1001
4 CS201 25021519 1002
5 CS202 25021519 1002
6 CS101 25021520 1001
7 CS102 25021520 1001
8 CS201 25021520 1002
9 CS202 25021520 1002
10 EE101 25031519 1004
11 EE102 25031519 1004
12 CS101 26021519 1001
13 CS102 26021519 1001
14 CS201 26021519 1002
15 CS202 26021519 1002
16 CS101 26021520 1001
17 CS102 26021520 1001
18 CS201 26021520 1002
19 CS202 26021520 1002
20 EE101 26031519 1004
21 EE102 26031519 1004
22 GEN101 25021519|25021520|25031519 1002
23 GEN102 25021519|25021520|25031519 1006
24 GEN101 26021519|26021520|26031519 1002
25 GEN102 26021519|26021520|26031519 1006

View File

@@ -0,0 +1,9 @@
course_id,course_name,course_type,credit_hours,is_general
CS101,Programming Fundamentals,theory,3,no
CS102,Programming Fundamentals Lab,lab,1,no
CS201,Data Structures,theory,3,no
CS202,Data Structures Lab,lab,1,no
EE101,Basic Electronics,theory,3,no
EE102,Basic Electronics Lab,lab,1,no
GEN101,Functional English,theory,3,yes
GEN102,Islamic Studies,theory,2,yes
1 course_id course_name course_type credit_hours is_general
2 CS101 Programming Fundamentals theory 3 no
3 CS102 Programming Fundamentals Lab lab 1 no
4 CS201 Data Structures theory 3 no
5 CS202 Data Structures Lab lab 1 no
6 EE101 Basic Electronics theory 3 no
7 EE102 Basic Electronics Lab lab 1 no
8 GEN101 Functional English theory 3 yes
9 GEN102 Islamic Studies theory 2 yes

View File

@@ -0,0 +1,160 @@
"""
Generates small illustrative dummy CSV datasets under data/dummy/ so the
timetable template generator has something to schedule and render.
Run once:
python data/dummy/generate_dummy_data.py
"""
import csv
import os
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
def write_csv(relative_path, header, rows):
path = os.path.join(BASE_DIR, relative_path)
os.makedirs(os.path.dirname(path), exist_ok=True)
with open(path, "w", newline="", encoding="utf-8") as f:
writer = csv.writer(f)
writer.writerow(header)
writer.writerows(rows)
print(f"wrote {len(rows)} rows -> {path}")
def main():
# ---- blocks & rooms (Building/Block A only) ----
write_csv(
"blocks/blocks.csv",
["block_id", "block_name"],
[["A", "Block A"]],
)
write_csv(
"blocks/rooms.csv",
["room_id", "room_name", "block_id", "room_type", "capacity"],
[
["A-101", "Room 101", "A", "classroom", 60],
["A-102", "Room 102", "A", "classroom", 60],
["A-103", "Room 103", "A", "classroom", 50],
["A-201", "Room 201", "A", "classroom", 60],
["A-L01", "Computer Lab 1", "A", "lab", 35],
["A-L02", "Computer Lab 2", "A", "lab", 35],
],
)
# ---- departments / programs / batches ----
# batch_code = session(2) + program_id(6) e.g. 25021519
batches_25 = [
["25021519", "CS", "BSCS", "25"],
["25021520", "CS", "BSSE", "25"],
["25031519", "EE", "BSEE", "25"],
]
batches_26 = [
["26021519", "CS", "BSCS", "26"],
["26021520", "CS", "BSSE", "26"],
["26031519", "EE", "BSEE", "26"],
]
write_csv(
"batch_codes/25/batches.csv",
["batch_code", "department", "program", "session"],
batches_25,
)
write_csv(
"batch_codes/26/batches.csv",
["batch_code", "department", "program", "session"],
batches_26,
)
all_batches = batches_25 + batches_26
# ---- instructors (4-digit employee codes) ----
instructors = [
["1001", "Dr. Ahsan Raza", "CS"],
["1002", "Ms. Sana Tariq", "CS"],
["1003", "Mr. Bilal Khan", "CS"],
["1004", "Dr. Farah Iqbal", "EE"],
["1005", "Mr. Usman Ali", "EE"],
["1006", "Ms. Hira Shah", "CS"],
]
write_csv(
"instructor/instructors.csv",
["instructor_code", "instructor_name", "department"],
instructors,
)
# ---- courses ----
# is_general courses are shared across all batches of the same session
# (so they can be scheduled together on Tuesday with no clash).
courses = [
["CS101", "Programming Fundamentals", "theory", 3, "no"],
["CS102", "Programming Fundamentals Lab", "lab", 1, "no"],
["CS201", "Data Structures", "theory", 3, "no"],
["CS202", "Data Structures Lab", "lab", 1, "no"],
["EE101", "Basic Electronics", "theory", 3, "no"],
["EE102", "Basic Electronics Lab", "lab", 1, "no"],
["GEN101", "Functional English", "theory", 3, "yes"],
["GEN102", "Islamic Studies", "theory", 2, "yes"],
]
write_csv(
"courses/courses.csv",
["course_id", "course_name", "course_type", "credit_hours", "is_general"],
courses,
)
# ---- course offerings: which course is taught to which batch, by whom ----
# General courses (GEN101/GEN102) are offered once per session (25/26)
# and shared across every batch in that session.
offerings = []
dept_theory_lab = {
"CS": [("CS101", "CS102"), ("CS201", "CS202")],
"EE": [("EE101", "EE102")],
}
dept_instructors = {
"CS": ["1001", "1002", "1003", "1006"],
"EE": ["1004", "1005"],
}
for batch_code, department, program, session in all_batches:
pairs = dept_theory_lab[department]
instr_pool = dept_instructors[department]
for i, (theory_id, lab_id) in enumerate(pairs):
instr = instr_pool[i % len(instr_pool)]
offerings.append([theory_id, batch_code, instr])
offerings.append([lab_id, batch_code, instr])
# general courses: one offering per (course, session), batch_group lists
# every batch code sharing that session, separated by "|"
for session, batch_group in (
("25", [b[0] for b in batches_25]),
("26", [b[0] for b in batches_26]),
):
offerings.append(["GEN101", "|".join(batch_group), "1002"])
offerings.append(["GEN102", "|".join(batch_group), "1006"])
write_csv(
"courses/course_offering.csv",
["course_id", "batch_code", "instructor_code"],
offerings,
)
# ---- students (roll_no = batch_code-seq) ----
students = []
for batch_code, department, program, session in all_batches:
for seq in range(1, 6): # 5 sample students per batch
roll_no = f"{batch_code}-{seq:03d}"
students.append([roll_no, batch_code, f"Student {roll_no}"])
write_csv(
"roll_no/students.csv",
["roll_no", "batch_code", "student_name"],
students,
)
print("\nDummy data generation complete.")
if __name__ == "__main__":
main()

View File

@@ -0,0 +1,7 @@
instructor_code,instructor_name,department
1001,Dr. Ahsan Raza,CS
1002,Ms. Sana Tariq,CS
1003,Mr. Bilal Khan,CS
1004,Dr. Farah Iqbal,EE
1005,Mr. Usman Ali,EE
1006,Ms. Hira Shah,CS
1 instructor_code instructor_name department
2 1001 Dr. Ahsan Raza CS
3 1002 Ms. Sana Tariq CS
4 1003 Mr. Bilal Khan CS
5 1004 Dr. Farah Iqbal EE
6 1005 Mr. Usman Ali EE
7 1006 Ms. Hira Shah CS

View File

@@ -0,0 +1,31 @@
roll_no,batch_code,student_name
25021519-001,25021519,Student 25021519-001
25021519-002,25021519,Student 25021519-002
25021519-003,25021519,Student 25021519-003
25021519-004,25021519,Student 25021519-004
25021519-005,25021519,Student 25021519-005
25021520-001,25021520,Student 25021520-001
25021520-002,25021520,Student 25021520-002
25021520-003,25021520,Student 25021520-003
25021520-004,25021520,Student 25021520-004
25021520-005,25021520,Student 25021520-005
25031519-001,25031519,Student 25031519-001
25031519-002,25031519,Student 25031519-002
25031519-003,25031519,Student 25031519-003
25031519-004,25031519,Student 25031519-004
25031519-005,25031519,Student 25031519-005
26021519-001,26021519,Student 26021519-001
26021519-002,26021519,Student 26021519-002
26021519-003,26021519,Student 26021519-003
26021519-004,26021519,Student 26021519-004
26021519-005,26021519,Student 26021519-005
26021520-001,26021520,Student 26021520-001
26021520-002,26021520,Student 26021520-002
26021520-003,26021520,Student 26021520-003
26021520-004,26021520,Student 26021520-004
26021520-005,26021520,Student 26021520-005
26031519-001,26031519,Student 26031519-001
26031519-002,26031519,Student 26031519-002
26031519-003,26031519,Student 26031519-003
26031519-004,26031519,Student 26031519-004
26031519-005,26031519,Student 26031519-005
1 roll_no batch_code student_name
2 25021519-001 25021519 Student 25021519-001
3 25021519-002 25021519 Student 25021519-002
4 25021519-003 25021519 Student 25021519-003
5 25021519-004 25021519 Student 25021519-004
6 25021519-005 25021519 Student 25021519-005
7 25021520-001 25021520 Student 25021520-001
8 25021520-002 25021520 Student 25021520-002
9 25021520-003 25021520 Student 25021520-003
10 25021520-004 25021520 Student 25021520-004
11 25021520-005 25021520 Student 25021520-005
12 25031519-001 25031519 Student 25031519-001
13 25031519-002 25031519 Student 25031519-002
14 25031519-003 25031519 Student 25031519-003
15 25031519-004 25031519 Student 25031519-004
16 25031519-005 25031519 Student 25031519-005
17 26021519-001 26021519 Student 26021519-001
18 26021519-002 26021519 Student 26021519-002
19 26021519-003 26021519 Student 26021519-003
20 26021519-004 26021519 Student 26021519-004
21 26021519-005 26021519 Student 26021519-005
22 26021520-001 26021520 Student 26021520-001
23 26021520-002 26021520 Student 26021520-002
24 26021520-003 26021520 Student 26021520-003
25 26021520-004 26021520 Student 26021520-004
26 26021520-005 26021520 Student 26021520-005
27 26031519-001 26031519 Student 26031519-001
28 26031519-002 26031519 Student 26031519-002
29 26031519-003 26031519 Student 26031519-003
30 26031519-004 26031519 Student 26031519-004
31 26031519-005 26031519 Student 26031519-005