Skip to content

Commit

Permalink
fixed undefined steps
Browse files Browse the repository at this point in the history
  • Loading branch information
shaluchan authored and ksauraj committed Oct 14, 2024
1 parent 6635c4e commit b13ba40
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 53 deletions.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
colorama==0.4.6
pandas==2.0.1
tqdm==4.66.5
101 changes: 48 additions & 53 deletions tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ def display_progress_bar(task_description, steps_completed, total=100, duration=
def pre_setup():
os.system("cls" if os.name == "nt" else "clear")
print(Fore.GREEN + ascii_art)
#progress bar for step-1
#progress bar for loading tool...
total=100
steps_completed= int(total*0.1)
display_progress_bar("STEP 1/10 ",steps_completed=steps_completed,total=total, duration=1.5)
steps_completed= int(total*1.0)
display_progress_bar("Loadiing Tool...",steps_completed=steps_completed,total=total, duration=0.3)

print(Fore.YELLOW + "Select Counseling type:")
print(Fore.GREEN + "1." + Fore.BLUE + "JOSAA")
Expand Down Expand Up @@ -80,10 +80,10 @@ def show_about_section():
def josaa_rounds_year():
os.system("cls" if os.name == "nt" else "clear")
print(Fore.GREEN + ascii_art)
# progress bar of step 2
# progress bar of step 1
total=100
steps_completed= int(total*0.2)
display_progress_bar("STEP 2/10 ",steps_completed=steps_completed,total=total, duration=1.5)
steps_completed= int(total*0.1)
display_progress_bar("STEP 1/10 ",steps_completed=steps_completed,total=total, duration=0.3)

print(Fore.YELLOW + "Select JOSAA round year")
print(Fore.GREEN + "1." + Fore.BLUE + "2022")
Expand All @@ -100,10 +100,10 @@ def josaa_rounds_year():
def josaa_rounds(josaa_round_year):
os.system("cls" if os.name == "nt" else "clear")
print(Fore.GREEN + ascii_art)
#progress bar for step-3
#progress bar for step-2
total=100
steps_completed= int(total*0.3)
display_progress_bar("STEP 3/10 ",steps_completed=steps_completed,total=total,duration=1.5)
steps_completed= int(total*0.2)
display_progress_bar("STEP 2/10 ",steps_completed=steps_completed,total=total,duration=0.3)
print("{Fore.YELLOW}Select JOSAA round {{josaa_round_year}}")

menu_options = [
Expand All @@ -127,10 +127,10 @@ def josaa_rounds(josaa_round_year):
def csab_rounds_year():
os.system("cls" if os.name == "nt" else "clear")
print(Fore.GREEN + ascii_art)
#progress bar for step-2
#progress bar for step-1
total=100
steps_completed= int(total*0.2)
display_progress_bar("STEP 2/10 ",steps_completed=steps_completed,total=total, duration=1.5)
steps_completed= int(total*0.1)
display_progress_bar("STEP 1/10 ",steps_completed=steps_completed,total=total, duration=0.3)

print(Fore.YELLOW + "Select CSAB round year")
print(Fore.GREEN + "1." + Fore.BLUE + "2021")
Expand All @@ -150,10 +150,10 @@ def csab_rounds_year():
def csab_rounds(csab_round_year):
os.system("cls" if os.name == "nt" else "clear")
print(Fore.GREEN + ascii_art)
#progress bar for step-3
#progress bar for step-2
total=100
steps_completed= int(total*0.3)
display_progress_bar("STEP 3/10 ",steps_completed=steps_completed,total=total, duration=1.5)
steps_completed= int(total*0.2)
display_progress_bar("STEP 2/10 ",steps_completed=steps_completed,total=total, duration=0.3)

print(f"{Fore.YELLOW}Select CSAB round ({csab_round_year})" )
print(Fore.GREEN + "1." + Fore.BLUE + "Round 1")
Expand Down Expand Up @@ -198,10 +198,10 @@ def csab_institue_types(df):
# clear the screen
os.system("cls" if os.name == "nt" else "clear")
print(Fore.GREEN + ascii_art)
#progress bar for step-4
#progress bar for step-3
total=100
steps_completed= int(total*0.4)
display_progress_bar("STEP 4/10 ",steps_completed=steps_completed,total=total, duration=1.5)
steps_completed= int(total*0.3)
display_progress_bar("STEP 3/10 ",steps_completed=steps_completed,total=total, duration=0.3)
# ask for user input for institute type
print(Fore.YELLOW + "Select Institute type:")
print(Fore.GREEN + "1." + Fore.BLUE + "ALL")
Expand Down Expand Up @@ -235,10 +235,10 @@ def josaa_institue_types(CSV_FILES):
# clear the screen
os.system("cls" if os.name == "nt" else "clear")
print(Fore.GREEN + ascii_art)
#progress bar for step-4
#progress bar for step-3
total=100
steps_completed= int(total*0.4)
display_progress_bar("STEP 4/10 ",steps_completed=steps_completed,total=total, duration=1.5)
steps_completed= int(total*0.3)
display_progress_bar("STEP 3/10 ",steps_completed=steps_completed,total=total, duration=0.3)
# ask for user input for institute type
print(Fore.YELLOW + "Select Institute type:")
print(Fore.GREEN + "1." + Fore.BLUE + "ALL (No IITs Included)")
Expand Down Expand Up @@ -285,10 +285,10 @@ def josaa_institue_types(CSV_FILES):
def filter_programs(institute_df):
os.system("cls" if os.name == "nt" else "clear")
print(Fore.GREEN + ascii_art)
#progress bar for step-5
#progress bar for step-4
total=100
steps_completed= int(total*0.5)
display_progress_bar("STEP 5/10 ",steps_completed=steps_completed,total=total, duration=1.5)
steps_completed= int(total*0.4)
display_progress_bar("STEP 4/10 ",steps_completed=steps_completed,total=total, duration=0.3)

print("Note: Programs marked with '*' will display all the programs similar to them.")
print("Select Program:")
Expand Down Expand Up @@ -490,7 +490,7 @@ def display_df_web(df, heading, subheading):
#progress bar for step-10
total=100
steps_completed= int(total*1.0)
display_progress_bar("STEP 10/10 ",steps_completed=steps_completed,total=total, duration=1.5)
display_progress_bar("STEP 10/10 ",steps_completed=steps_completed,total=total, duration=0.3)


print(filename)
Expand Down Expand Up @@ -535,17 +535,27 @@ def main(df):
os.system("cls" if os.name == "nt" else "clear")
filtered_df = filter_programs(institute_df)

def filter_by_choices(choices, column_name):
def filter_by_choices(choices, column_name, steps):
unique_choices = institute_df[column_name].unique()

os.system("cls" if os.name == "nt" else "clear")
print(Fore.GREEN + ascii_art)

total=100
steps_completed=int(total*steps)
steps_count = int(steps*10)
str_steps=f"STEP {steps_count}/10"
display_progress_bar(str_steps,steps_completed=steps_completed,total=total, duration=0.3)


print(f"{Fore.YELLOW}Select {column_name}:")

print(Fore.GREEN + "1." + Fore.BLUE +" All")
for i, choice in enumerate(unique_choices, start=2):
print(f"{Fore.GREEN}{i}. {Fore.BLUE}{choice}{Fore.RESET}")



print(f"{Fore.YELLOW}")
print(f"You are Selecting {column_name}")
choices_input = input("Choose Options ((space-separated, e.g., 2 3 4) & 1 for all choices) : ")
Expand All @@ -558,43 +568,28 @@ def filter_by_choices(choices, column_name):
filtered_choices = [unique_choices[i] for i in selected_choices]
return filtered_df[filtered_df[column_name].isin(filtered_choices)]

filtered_df = filter_by_choices(institute_df["Institute"], "Institute")
os.system("cls" if os.name == "nt" else "clear")
print(Fore.GREEN + ascii_art)
total=100
steps_completed= int(total*0.6)
display_progress_bar("STEP 6/10 ",steps_completed=steps_completed,total=total, duration=1.5)

filtered_df = filter_by_choices(institute_df["Quota"], "Quota")
os.system("cls" if os.name == "nt" else "clear")
print(Fore.GREEN + ascii_art)
total=100
steps_completed= int(total*0.7)
display_progress_bar("STEP 7/10 ",steps_completed=steps_completed,total=total, duration=1.5)

filtered_df = filter_by_choices(institute_df["Seat Type"], "Seat Type")
os.system("cls" if os.name == "nt" else "clear")
print(Fore.GREEN + ascii_art)
total=100
steps_completed= int(total*0.8)
display_progress_bar("STEP 8/10 ",steps_completed=steps_completed,total=total, duration=1.5)
filtered_df = filter_by_choices(institute_df["Institute"], "Institute",0.5)

filtered_df = filter_by_choices(institute_df["Quota"], "Quota",0.6)

filtered_df = filter_by_choices(institute_df["Seat Type"], "Seat Type",0.7)


filtered_df = filter_by_choices(institute_df["Gender"], "Gender",0.8)



filtered_df = filter_by_choices(institute_df["Gender"], "Gender")
os.system("cls" if os.name == "nt" else "clear")
print(Fore.GREEN + ascii_art)
total=100
steps_completed= int(total*0.9)
display_progress_bar("STEP 9/10 ",steps_completed=steps_completed,total=total, duration=1.5)


os.system("cls" if os.name == "nt" else "clear")
display_progress_bar("STEP 9/10 ",steps_completed=90,total=100, duration=0.3)
rank = int(input(Fore.YELLOW + "Enter your rank: " + Fore.RESET))
filtered_df["Closing Rank"] = filtered_df["Closing Rank"].astype(
str).str.extract(r"(\d+)").astype(int)
filtered_df = filtered_df[filtered_df["Closing Rank"] > rank].sort_values(
by=["Closing Rank"], ascending=True)

os.system("cls" if os.name == "nt" else "clear")
print(Fore.GREEN + ascii_art)
display_df_web(filtered_df, "JEE Counsellor", "-By Ksauraj")
print(
Fore.GREEN +
Expand Down

0 comments on commit b13ba40

Please sign in to comment.