Skip to content

Commit

Permalink
Reverted Attempts to ADD to JSON File.
Browse files Browse the repository at this point in the history
  • Loading branch information
j-sund committed Nov 30, 2023
1 parent 471f051 commit 7340876
Showing 1 changed file with 4 additions and 38 deletions.
42 changes: 4 additions & 38 deletions rpi_data/modules/pdf_scrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,45 +64,11 @@ def parse_pdf(pdf_path):
possible_locs = []



# Get the final exam schedule year.
exam_year = finals[0].split()[1]



for x in range(len(finals)):

possible_string = ""
if "BY SUBJECT" in finals[x] and x < len(finals) - 4:

courses = finals[x+2].split("\n")

loc = finals[x+3].split("\n")

#print(courses)

for y in range(len(courses)):

k = 0
while(y+1 < len(courses) and courses[y] != courses[y+1]):

if (k == 0):
print(courses[y])
k += 1

courses.pop(y+1)

y += 1










exit
for i in range(len(finals)):

if "BY SUBJECT" in finals[i] and i < len(finals) - 4:
Expand Down Expand Up @@ -203,12 +169,12 @@ def parse_pdf(pdf_path):

data_list.append(entry)

#with open('final_schedule.json', 'a') as json_file:
with open('final_schedule.json', 'a') as json_file:

#json_file.write(json.dumps(entry) + '\n')
json_file.write(json.dumps(entry) + '\n')


#json_file.close()
json_file.close()


'''
Expand Down

0 comments on commit 7340876

Please sign in to comment.