Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
450 commits
Select commit Hold shift + click to select a range
9b98376
added basic navbar
tashifkhan Jul 19, 2025
4155610
style better
tashifkhan Jul 19, 2025
6d5e277
added proper navigation for the website
tashifkhan Jul 19, 2025
eaa31de
removed redundant bottons
tashifkhan Jul 19, 2025
973de7b
updated the academic calender
tashifkhan Jul 19, 2025
44c662b
added a basic comparision page
tashifkhan Jul 19, 2025
0dd5ce1
visual flair
tashifkhan Jul 19, 2025
62df9b4
class wise grping
tashifkhan Jul 19, 2025
cbcfe3e
shadcn selector
tashifkhan Jul 19, 2025
09b761c
mobile optimiisations pt1
tashifkhan Jul 19, 2025
9196a41
colors better
tashifkhan Jul 19, 2025
73ffd48
sorting time slots
tashifkhan Jul 19, 2025
8ff803c
can't figure out the card
tashifkhan Jul 19, 2025
dd7a6ca
prettier
tashifkhan Jul 19, 2025
390c985
sitemap and all
tashifkhan Jul 19, 2025
9b893cc
modernised the timeline
tashifkhan Jul 19, 2025
8d2ed5b
updated timetine view
tashifkhan Jul 19, 2025
3e903bd
updated navbar
tashifkhan Jul 19, 2025
dc0a77a
added modals for details
tashifkhan Jul 19, 2025
1b733ae
width fix
tashifkhan Jul 19, 2025
0a01c2a
removed redundent code
tashifkhan Jul 19, 2025
35edda9
updated padding for better mobile exp.
tashifkhan Jul 19, 2025
969b487
forgot version lol
tashifkhan Jul 19, 2025
44514ba
added posthog analytics
tashifkhan Jul 19, 2025
540f872
added instructions
tashifkhan Jul 19, 2025
76087b9
fixed name_extractor as well as softcomputing issue
tashifkhan Jul 20, 2025
c4b8a89
updated colors
tashifkhan Jul 21, 2025
1ad2aa5
updated the mapping implementation
tashifkhan Jul 21, 2025
cacccaf
exception handelling
tashifkhan Jul 21, 2025
2d7f2bc
edits work now
tashifkhan Jul 21, 2025
26622c7
updated to make downloads look better
tashifkhan Jul 21, 2025
6ea6c05
removed bg
tashifkhan Jul 21, 2025
c803940
added load configs in compare tt
tashifkhan Jul 21, 2025
fe6e820
improved icons / designs
tashifkhan Jul 21, 2025
f7c35d2
added the share config option
tashifkhan Jul 21, 2025
5c1fde1
updated positions
tashifkhan Jul 21, 2025
72bc977
improved share modal design
tashifkhan Jul 21, 2025
5375c8e
app consistent
tashifkhan Jul 21, 2025
d6bf397
fixed the blank page issue in /timeline
tashifkhan Jul 21, 2025
9860e37
auto scroll to the current time in /timeline page
tashifkhan Jul 21, 2025
603d4b1
removed black bage issue completely
tashifkhan Jul 21, 2025
642fd14
added not found page
tashifkhan Jul 21, 2025
ef81ea5
added made the navigation possible usig swipes as well
tashifkhan Jul 21, 2025
cfa1602
fixed mobile navigation
tashifkhan Jul 21, 2025
079916f
upadted readme for v2
tashifkhan Jul 21, 2025
9298ac5
updated packages
tashifkhan Jul 21, 2025
65bcde4
fixed the wripping issue
tashifkhan Jul 21, 2025
1e589aa
updated to odd sem
tashifkhan Jul 21, 2025
0bcd810
2nd year 128 json added
tashifkhan Jul 21, 2025
fc2be4c
Consumer Behaviour -> becuase these dumb fucks can't even make a cor…
tashifkhan Jul 21, 2025
18969a5
url params issue fixed
tashifkhan Jul 21, 2025
945b093
updated for 4th year 128
tashifkhan Jul 22, 2025
95fb99e
minot parsing error fixed
tashifkhan Jul 22, 2025
3f362db
parsing error fixed
tashifkhan Jul 23, 2025
d684a3e
added bca data
tashifkhan Jul 23, 2025
fcd32f1
adding bca input
tashifkhan Jul 23, 2025
df71bcc
batch errors resolved
tashifkhan Jul 23, 2025
8f4d385
added v1 of bca creator
tashifkhan Jul 23, 2025
1ac7709
integrating bca creator
tashifkhan Jul 23, 2025
ce69a39
major error handelling
tashifkhan Jul 23, 2025
8a66eba
updated mapping
tashifkhan Jul 23, 2025
6ba44f2
time slot processing fix
tashifkhan Jul 23, 2025
389e472
updated wasm renderer
tashifkhan Jul 23, 2025
406ca1a
finally encountered null pointer issue lol
tashifkhan Jul 23, 2025
47c0b4b
no black screen anymore
tashifkhan Jul 23, 2025
dbcb4eb
mapping fix
tashifkhan Jul 23, 2025
7747c88
updated 2nd year 128 subjects with the new tt
tashifkhan Jul 23, 2025
0909f50
bca update compare timetables
tashifkhan Jul 23, 2025
8db29c7
auto scroll to the day and time on the timeline view
tashifkhan Jul 24, 2025
2cf1293
implemented scroll in the academic calender as well
tashifkhan Jul 24, 2025
3bfd208
ph
tashifkhan Jul 24, 2025
4903b5c
revert ph
tashifkhan Jul 24, 2025
cec7575
updated 3rd year timetable
tashifkhan Jul 25, 2025
e49cd79
correcting timetable comittee mistakes ffs
tashifkhan Jul 25, 2025
40f2c19
god damn it what a piece of shot the tt is
tashifkhan Jul 25, 2025
d227007
vercel posthog deployement
tashifkhan Jul 25, 2025
b5e9935
resolving conflict
tashifkhan Jul 25, 2025
71b21a7
removing jackass api
tashifkhan Jul 25, 2025
be27e23
updated schema
tashifkhan Jul 25, 2025
e77673f
updated acc to docs
tashifkhan Jul 25, 2025
74b302d
added a basic menu page
tashifkhan Jul 30, 2025
e1e5ba8
added route
tashifkhan Jul 30, 2025
e6319bd
added scroll to the current day
tashifkhan Jul 30, 2025
bbcedf3
updated sitemap
tashifkhan Jul 30, 2025
677a3d6
updated visual hiarchy
tashifkhan Jul 30, 2025
e92127c
added to sidebar
tashifkhan Jul 30, 2025
baa12ec
updated menu page to be consistent
tashifkhan Jul 30, 2025
a1b972f
minor navbar bug resolved
tashifkhan Jul 30, 2025
f99d21b
updated readme
tashifkhan Jul 30, 2025
2ed5db9
spacing
tashifkhan Jul 30, 2025
4f917cb
scroll fix mobile
tashifkhan Jul 30, 2025
831e9d5
outdated menu check
tashifkhan Aug 1, 2025
d90969a
minor updates
tashifkhan Aug 3, 2025
47f2546
added holiday filter
tashifkhan Aug 7, 2025
5bc5435
updated logo
tashifkhan Aug 30, 2025
4828ed5
updaed icon and ui
tashifkhan Aug 31, 2025
b57d112
Updated splash screen
tashifkhan Aug 31, 2025
362b952
updated the Algortithum Analysis
tashifkhan Sep 24, 2025
11daa37
copied ekenents
tashifkhan Dec 4, 2025
1852a65
initalised and added packages
tashifkhan Dec 4, 2025
6454180
updted to tailwind v4
tashifkhan Dec 4, 2025
2cbdf8a
moved to data directory
tashifkhan Dec 4, 2025
ac73793
added shdcn componets
tashifkhan Dec 4, 2025
0d7d649
added html to canvas util
tashifkhan Dec 4, 2025
43e0d95
added user context api
tashifkhan Dec 4, 2025
4715157
created raw formatted table json api
tashifkhan Dec 4, 2025
33a001c
added cobined 128 and 62 api
tashifkhan Dec 4, 2025
8561a8f
serving academic calender as api
tashifkhan Dec 4, 2025
a34f392
added 404 not found page
tashifkhan Dec 4, 2025
a94379d
added layout with proprt page titles and metta data
tashifkhan Dec 4, 2025
92ce2fe
loading screen
tashifkhan Dec 4, 2025
81631bc
clinet side home oage compoent
tashifkhan Dec 4, 2025
845fea5
added posthog
tashifkhan Dec 4, 2025
1db2738
updated the entrypoint
tashifkhan Dec 4, 2025
7c62f24
refactored academic calender to use the api
tashifkhan Dec 4, 2025
8181a88
refactored for better legibilty
tashifkhan Dec 4, 2025
1f73476
creadted a proper navbar now
tashifkhan Dec 4, 2025
a72fe68
refactored to include 128 menu
tashifkhan Dec 4, 2025
144ad78
fixed rendering issue
tashifkhan Dec 4, 2025
05ccb37
fixed the export issue with the download entry point
tashifkhan Dec 4, 2025
5be1024
copied compoentes from the react app
tashifkhan Dec 4, 2025
bcfd34b
fixed bg rendering issue of loader
tashifkhan Dec 4, 2025
76b8ae2
proxy for posthog
tashifkhan Dec 4, 2025
f281c26
added mobile navbar
tashifkhan Dec 4, 2025
ee26337
fixed posthog shit
tashifkhan Dec 4, 2025
b3211be
fixed navbar overlap
tashifkhan Dec 4, 2025
72718bf
added pwa support
tashifkhan Dec 4, 2025
a4aa85a
google calendar look
tashifkhan Dec 4, 2025
6ce9909
glassmorphic look
tashifkhan Dec 4, 2025
88ac745
improved mobile responsiveness of the timeline header and default the…
tashifkhan Dec 4, 2025
4c1faa8
fuxed download
tashifkhan Dec 4, 2025
7b2bdb4
updted the view
tashifkhan Dec 4, 2025
9c48aa3
added github link
tashifkhan Dec 4, 2025
5e0f68e
fixed navbar obstrction
tashifkhan Dec 4, 2025
ad83115
mobile friendly calender
tashifkhan Dec 4, 2025
d7d1a0c
added the academic calender to the timeline
tashifkhan Dec 4, 2025
5642e36
removed the legacy react app
tashifkhan Dec 4, 2025
d8b8205
organised
tashifkhan Dec 4, 2025
e5894d6
added requirements.txt
tashifkhan Dec 4, 2025
b667a09
Add 'parser/' from commit 'cadab613dad5f71481611ab12128ada4b8ff132c'
tashifkhan Dec 4, 2025
b6f9b16
Merge pull request #12 from tashifkhan/refactor/next-migration
tashifkhan Dec 4, 2025
8b00c7c
generation stuck error fixed
tashifkhan Dec 5, 2025
b5f8830
renamed
tashifkhan Dec 5, 2025
0ffdedf
updated to use gemini 3
tashifkhan Dec 5, 2025
79501e9
added swagger ui api docs
tashifkhan Dec 5, 2025
ec78110
updated docs
tashifkhan Dec 5, 2025
926f46d
added api docs to the sitemap
tashifkhan Dec 5, 2025
bb0f76d
updated heading
tashifkhan Dec 5, 2025
a553e85
organisation better
tashifkhan Dec 5, 2025
7e1d12a
title issue fixed
tashifkhan Dec 5, 2025
4be7e39
added edit opion in timeline as well
tashifkhan Dec 5, 2025
2a4fad8
added better api docs
tashifkhan Dec 5, 2025
ac8f43c
updated dep
tashifkhan Dec 5, 2025
383f536
updated loader
tashifkhan Dec 7, 2025
75852e8
fixed vul
tashifkhan Dec 7, 2025
3539a16
Add analytics section to README
tashifkhan Dec 7, 2025
d89be7e
Remove data section from README
tashifkhan Dec 8, 2025
b59fe4a
holiday red color timeline
tashifkhan Dec 11, 2025
ff832a6
updated to the new simplified parser logic
tashifkhan Dec 20, 2025
94e1ebe
archieve
tashifkhan Dec 20, 2025
ad9896b
initialised modules
tashifkhan Dec 20, 2025
18e53f3
added 128 common utils
tashifkhan Dec 20, 2025
4a7087d
added common utils
tashifkhan Dec 20, 2025
3333657
added legacy implemetation -> _creator.py
tashifkhan Dec 20, 2025
3d29794
added bca parser utils
tashifkhan Dec 20, 2025
96de86b
added python gitignore
tashifkhan Dec 20, 2025
7b0d5e3
consolodated creater functions
tashifkhan Dec 20, 2025
56ef30e
imported modules
tashifkhan Dec 20, 2025
4156b1b
added to be built in issue
tashifkhan Dec 20, 2025
636d4a9
added build process
tashifkhan Dec 20, 2025
2b7cac6
refactor: replace useQueryState with useState for isGenerating
tashifkhan Dec 23, 2025
e93202d
Merge pull request #30 from tashifkhan/fix/isGenerating-param
tashifkhan Dec 23, 2025
26f6f04
enhanced menu outdated check and display logic
tashifkhan Dec 23, 2025
6510c85
Merge pull request #31 from tashifkhan/fix/mess-mennu-outdated-scroll
tashifkhan Dec 23, 2025
a166541
added react query
tashifkhan Dec 23, 2025
6e7e0a3
added a api client
tashifkhan Dec 23, 2025
35d2c5d
added react query provider
tashifkhan Dec 23, 2025
371c3d5
integrated React Query for data fetching in various components
tashifkhan Dec 23, 2025
c90ef58
Merge pull request #32 from tashifkhan/feat/react-query
tashifkhan Dec 23, 2025
59b5eb4
implemented iCal file generation and download for academic timetable
tashifkhan Dec 23, 2025
db554d5
added download functionality for iCal files in calendar and action bu…
tashifkhan Dec 23, 2025
9ac2c57
Merge pull request #33 from tashifkhan/feat/ical-generator
tashifkhan Dec 23, 2025
9a959ca
mobile optimise academic calendar
tashifkhan Dec 23, 2025
03c6176
Merge pull request #34 from tashifkhan/feat/ical-generator
tashifkhan Dec 23, 2025
8b8d15b
added requirements
tashifkhan Dec 26, 2025
858be21
added better doc strings
tashifkhan Dec 26, 2025
fa455fb
added gitignore for the streamlit apps
tashifkhan Dec 26, 2025
c28519f
added docs as well
tashifkhan Dec 26, 2025
51f2b46
Merge pull request #37 from tashifkhan/feat/creator-enhancements
tashifkhan Dec 26, 2025
618e78e
added EVEN26 data 2nd year 62
tashifkhan Dec 26, 2025
4aafa7a
better schema arramgement
tashifkhan Dec 26, 2025
a5eb567
normalised the timeslot
tashifkhan Dec 27, 2025
24963fa
add 1 year, but full code missing
tashifkhan Dec 27, 2025
5fea142
added 3rd year data but need to verify once
tashifkhan Dec 27, 2025
43a4514
added 4th year subjects
tashifkhan Dec 27, 2025
e7f0cb6
added 128 first year time table
tashifkhan Dec 27, 2025
480d450
bca 2nd year (maybe wromg seems like 3rd sem tho)
tashifkhan Dec 27, 2025
8858f30
Merge pull request #42 from tashifkhan/add/EVEN26
tashifkhan Dec 27, 2025
ce5637b
extracted smart default semester selection logic into a reusable hook…
tashifkhan Dec 27, 2025
ddc6009
set the default academic year for the academic calendar
tashifkhan Dec 27, 2025
3c10cd5
Merge pull request #43 from tashifkhan/add/EVEN26
tashifkhan Dec 27, 2025
8a77283
fixed minot reload bug
tashifkhan Dec 27, 2025
3e4393f
Merge pull request #44 from tashifkhan/add/EVEN26
tashifkhan Dec 27, 2025
5265016
added banner telling the current state
tashifkhan Dec 27, 2025
d717e3b
Merge pull request #45 from tashifkhan/add/EVEN26
tashifkhan Dec 27, 2025
2e1405b
fixed typo
tashifkhan Dec 28, 2025
cf4c9d7
added maintainers
tashifkhan Dec 28, 2025
470685b
handel LMinor edge case
tashifkhan Dec 28, 2025
8c503f6
handelled edge case for LCSE,ECE,BT
tashifkhan Dec 28, 2025
bae57ad
feature parity
tashifkhan Dec 28, 2025
290d7cc
added meta creator
tashifkhan Dec 28, 2025
86f44bc
added pydantic
tashifkhan Dec 28, 2025
f25647c
added types
tashifkhan Dec 28, 2025
cf55e24
added create and compare as well
tashifkhan Dec 28, 2025
9b812d9
added proper build process
tashifkhan Dec 28, 2025
7757a83
added docs for the parser
tashifkhan Dec 28, 2025
4da435d
fixed build issues
tashifkhan Dec 28, 2025
3896750
resolved first year issues
tashifkhan Dec 28, 2025
4420a3b
fixed and mode crazy abstarctions coz ptdantic can't be loaded in wasm
tashifkhan Dec 28, 2025
af0e9a7
used the build instead of _creator
tashifkhan Dec 28, 2025
5c09209
fixed the json struct of BCA 2nd year
tashifkhan Dec 28, 2025
4e9c8d8
Merge pull request #49 from tashifkhan/add/EVEN26
tashifkhan Dec 28, 2025
6994615
added 128 3rd year data
tashifkhan Dec 28, 2025
edfea49
fixed subjects extractor using ai
tashifkhan Dec 28, 2025
e0b7e0f
updated for edge cases
tashifkhan Dec 28, 2025
e0bf97e
added a new runner for easy execution
tashifkhan Dec 28, 2025
f971d5a
upadted docs
tashifkhan Dec 28, 2025
aa5da24
Merge branch 'add/EVEN26'
tashifkhan Dec 28, 2025
b4a220a
fixed or edge case
tashifkhan Dec 28, 2025
0b9da6c
Merge branch 'add/EVEN26'
tashifkhan Dec 28, 2025
b306adb
updated the notice for 128 folks
tashifkhan Dec 28, 2025
7e5949a
updated docs
tashifkhan Dec 28, 2025
61e52bc
added scroll to show generated
tashifkhan Dec 29, 2025
7365846
Compare Timetable redesign
tashifkhan Dec 29, 2025
3838e11
closes #51
tashifkhan Dec 29, 2025
189d750
fixed major parsing and comp issue
tashifkhan Dec 29, 2025
5dfbba4
headder fkix
tashifkhan Dec 29, 2025
e915831
form page fix
tashifkhan Dec 29, 2025
da521e2
better desktop grad
tashifkhan Dec 29, 2025
1e5632d
added portal flow mock
tashifkhan Dec 29, 2025
6ca3d70
fixed for cleary
tashifkhan Dec 30, 2025
ba6721a
Fixed the timetable parsing error for jiit-128-3rd year
ShauryaRahlon Jan 15, 2026
6f1b786
Merge pull request #53 from tashifkhan/Fixed-Parsing-Error
ShauryaRahlon Jan 15, 2026
96db65b
Adding 2nd years timetable for 128 campus
ShauryaRahlon Jan 16, 2026
857610d
Update website/data/time-table/2026/EVEN26/128.json
ShauryaRahlon Jan 16, 2026
80b08ec
Merge pull request #54 from tashifkhan/Adding-2nd-Year
ShauryaRahlon Jan 16, 2026
e2e751e
unified view for mess menu
tashifkhan Feb 14, 2026
c455cca
added haptics
tashifkhan Mar 5, 2026
081811e
updated haptic intensity
tashifkhan Mar 5, 2026
3033bff
changed pyodide version from 27.0 -> 27.7
sharma-anuj Mar 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 25 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
.env
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
blah.py
data
.gitignore
.DS_Store
\templet\*
__pycache__
*.pyc
hello.csv
uploads
styles.scss
.vercel
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
.env

.vite
15 changes: 15 additions & 0 deletions .legacy/parser/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.env
.idea
blah.py
data
.DS_Store
__pycache__
*.pyc
hello.csv
uploads
styles.scss
.vercel
emsdk
.pyodide-xbuildenv-0.29.2
UNKNOWN.egg-info
test.py
Empty file.
220 changes: 220 additions & 0 deletions .legacy/parser/modules/BE128_creator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
from datetime import datetime
import re
from typing import List

def batch_extractor128(text: str) -> str:
start_bracket = text.find('(')
if start_bracket != -1:
return text[1:start_bracket].strip()
return text

def subject_extractor128(text: str) -> str:
start_bracket = text.find('(')
if start_bracket != -1:
end_bracket = text.find(')', start_bracket)
if end_bracket != -1:
return text[start_bracket + 1:end_bracket]
return text

def faculty_extractor128(text: str) -> str:
start_bracket = text.find('/')
if start_bracket != -1:
return text[start_bracket+1:].strip()
return text

def expand_batch128(batch_code):
"""Expand batch code into list of individual batches."""
if not batch_code:
return []

if batch_code == 'ALL':
return ['E', 'F']

matches = re.findall(r'([A-Z])(\d+)', batch_code)
if matches:
return [f"{letter}{number}" for letter, number in matches]

return [batch_code]

def location_extractor128(text: str) -> str:
parts = text.split('-')
if len(parts) < 2:
return text

location = parts[-1].split('/')[0]
return location.strip()

def is_batch_included128(search_batch: str, extracted_batch_input: str) -> bool:
if not extracted_batch_input:
return True
batch_list = expand_batch128(extracted_batch_input.strip())
if search_batch in batch_list:
return True
for batch in batch_list:
if len(batch) == 1 and search_batch[0] == batch:
return True
return False

def process_day128(day_str: str) -> str:
day_mapping = {
'MON': 'Monday',
'M': 'Monday',
'MONDAY': 'Monday',
'TUES': 'Tuesday',
'TUE': 'Tuesday',
'T': 'Tuesday',
'TUESDAY': 'Tuesday',
'WED': 'Wednesday',
'W': 'Wednesday',
'WEDNESDAY': 'Wednesday',
'THUR': 'Thursday',
'THURS': 'Thursday',
'THURSDAY': 'Thursday',
'THU': 'Thursday',
'TH': 'Thursday',
'FRI': 'Friday',
'FRIDAY': 'Friday',
'F': 'Friday',
'SAT': 'Saturday',
'S': 'Saturday',
'SA': 'Saturday',
'SATURDAY': 'Saturday',
'SATUR': 'Saturday',
'SUN': 'Sunday',
'SU': 'Sunday',
'U': 'Sunday',
'SUNDAY': 'Sunday'
}

day_str = day_str.strip().upper()
return day_mapping.get(day_str, day_str)

def convert_time_format128(time_str):
time_str = time_str.strip().replace(' ', '')

if 'AM' in time_str or 'PM' in time_str:
if ':' not in time_str:
time_str = time_str.replace('AM', ':00 AM').replace('PM', ':00 PM')

time_str = time_str.replace('AM', ' AM').replace('PM', ' PM')

try:
return datetime.strptime(time_str, '%I:%M %p').strftime('%H:%M')
except ValueError as e:
raise ValueError(f"Error parsing time string '{time_str}': {e}")

def process_timeslot128(timeslot: str, type: str = "L") -> tuple[str]:
try:
timeslot = timeslot.replace('12 NOON', '12:00 PM').replace('NOON', '12:00 PM')

start_time, end_time = timeslot.split('-')

start_time = start_time.strip()
end_time = end_time.strip().replace('.', ':')

if not ('AM' in start_time.upper() or 'PM' in start_time.upper()):
if len(start_time.split(':')[0].strip()) == 1:
start_time = "0" + start_time
if int(start_time.split(':')[0]) < 7:
start_time += " PM"
else:
start_time += " AM"

if not ('AM' in end_time.upper() or 'PM' in end_time.upper()):
if len(end_time.split(':')[0].strip()) == 1:
end_time = "0" + end_time
if int(end_time.split(':')[0]) < 7:
end_time += " PM"
else:
end_time += " AM"

start_time_24 = convert_time_format128(start_time)
end_time_24 = convert_time_format128(end_time)

if type == "P":
end_hour = int(end_time_24.split(':')[0])
end_min = end_time_24.split(':')[1]
end_hour = (end_hour + 1) % 24
end_time_24 = f"{end_hour:02d}:{end_min}"

if start_time_24 == "00:00":
start_time_24 = "12:00"
if end_time_24[3:] == "50":
end_time_24 = f"{int(end_time_24[:2])+1}:00"
return start_time_24, end_time_24
except Exception as e:
print(f"Error processing timeslot '{timeslot}': {e}")
return "00:00", "00:00"

def is_elective128(extracted_batch:str):
if extracted_batch == "ALL":
return True
return False

def do_you_have_subject(subject_codes: List[str], subject_code: str) -> bool:
if subject_code in subject_codes:
return True
return False

def subject_name128(subjects_dict: dict, code: str) -> str:
for subject in subjects_dict:
if subject["fullCode"] == code:
return subject["subject"]
if subject["code"] == code:
return subject["subject"]
return code

def banado128(time_table_json: dict, subject_json: dict, batch: str, subject_codes: List[str]) -> dict:
# try:
time_table = time_table_json
subject = subject_json
your_time_table = []

days = list(time_table.keys())
# Iterate through each day in the timetable
for day in days:
time_slots = time_table[day]
time_slot_keys = list(time_slots.keys())
for time in time_slot_keys:
classes = time_slots[time]
if not isinstance(classes, list):
continue
for indi_class in classes:
if not isinstance(indi_class, str):
continue
code = subject_extractor128(indi_class.strip())
batchs = batch_extractor128(indi_class.strip())

if do_you_have_subject(subject_codes=subject_codes, subject_code=code) and is_batch_included128(batch, batchs):
your_time_table.append([day, time, subject_name128(subject, code), indi_class.strip()[0], location_extractor128(indi_class.strip())])

formatted_timetable = {}

for entry in your_time_table:
day = process_day128(entry[0])
time = entry[1]
start_time, end_time = process_timeslot128(time, entry[3])

if entry[2] in ["ENGINEERING DRAWING AND DESIGN", "Engineering Drawing & Design"]:
end_time = f"{int(end_time[:2])+1}{end_time[2:]}"

if day not in formatted_timetable:
formatted_timetable[day] = {}
# Format end time to ensure it's in HH:MM format
if len(end_time) == 4: # If end time is like "1100"
end_time = f"{end_time[:2]}:{end_time[2:]}"

if entry[2].strip() == entry[2].strip().upper():
entry[2] = entry[2].strip().title()

formatted_timetable[day][f"{start_time}-{end_time}"] = {
"subject_name": entry[2],
"type": entry[3],
"location": entry[4]
}

return formatted_timetable

# except Exception as e:
# print(f"{str(e)}")
# return {}
11 changes: 10 additions & 1 deletion modules/_creator.py → .legacy/parser/modules/BE62_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ def subject_extractor(text: str) -> str:
end_bracket = text.find(')', start_bracket)
if end_bracket != -1:
return text[start_bracket + 1:end_bracket]
return ""
elif dash := text.find('-'):
return text[start_bracket + 1:dash]
return text

def location_extractor(text: str) -> str:
parts = text.split('-')
Expand Down Expand Up @@ -150,6 +152,8 @@ def subject_name_extractor(subjects_dict: dict, code: str) -> str:
return subject["Subject"]
if str(subject["Full Code"][3:5] + subject["Code"]).strip() == code.strip():
return subject["Subject"]
if str(subject["Code"][1:]).strip() == code.strip():
return subject["Subject"]
return code

def do_you_have_elective(elective_subject_codes: List[str], subject_code: str, subject_dict :dict) -> bool:
Expand All @@ -174,6 +178,8 @@ def do_you_have_elective(elective_subject_codes: List[str], subject_code: str, s
return True
if elective["Full Code"][3:5] + elective["Code"] == subject_code:
return True
if elective["Code"][1:] == subject_code:
return True
return False

def process_day(day_str: str) -> str:
Expand Down Expand Up @@ -326,6 +332,9 @@ def time_table_creator(time_table_json: dict, subject_json: dict, batch: str, el
day = process_day(entry[0])
time = entry[1]
start_time, end_time = process_timeslot(time, entry[3])

if entry[2].strip() in ["ENGINEERING DRAWING AND DESIGN", "Engineering Drawing & Design"]:
end_time = f"{int(end_time[:2])+1}{end_time[2:]}"

if day not in formatted_timetable:
formatted_timetable[day] = {}
Expand Down
Loading