Files
VSTU_Schedule_Parser/main.py
2025-09-11 10:47:21 +03:00

22 lines
591 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import json
import xlrd
import parser
import utils
import json
# Общее правило проекта, сначала в координатах идёт ROW а потом COL, нумерация с нуля
book = xlrd.open_workbook("ОН_ФЭВТ_2 курс.xls", formatting_info=True)
print("The number of worksheets is {0}".format(book.nsheets))
print("Worksheet name(s): {0}".format(book.sheet_names()))
sh = book.sheet_by_index(0)
prs = parser.Parser(sh)
prs.parse()
json.dump(prs.groups, open('groups.json', 'w'), indent=2, ensure_ascii=False)
print("Saved to groups.json")