backend tooling for modulplaner-frontend
|
|
1 mesiac pred | |
|---|---|---|
| config | 1 mesiac pred | |
| parse | 1 mesiac pred | |
| .gitignore | 1 mesiac pred | |
| LICENSE | 1 mesiac pred | |
| README.md | 1 mesiac pred | |
| extract_lecturer_shorthands_pdf.py | 1 mesiac pred | |
| parse_class_pdf.py | 1 mesiac pred | |
| requirements.txt | 1 mesiac pred | |
| rip_modulplaner_frontend_data.py | 1 mesiac pred |
Provides backend tooling for modulplaner.
Because the original repo only contains frontend code and data updates were slow and intransparent, I created this repo as a solution.
You need to install
requirements.txtFor some simple commands mentioned in this documentat, It is also recommended to install and setup
This section is split into the different script provided by this repository.
Execute the following to parse a class timetable PDF into the classes.json file needed by the frontend.
./parse_class_pdf.py [-h] [-l LECTURERS] [-i INPUT] [-o OUTPUT] [--save-intermediate SAVE_INTERMEDIATE] [--load-intermediate LOAD_INTERMEDIATE]
-i, --input: Path to the input PDF file. Defaults to klassen.pdf.-o, --output: Path to the output JSON file. Defaults to classes.json.-l, --lecturers: Path to the lecturers.json file. If provided, it is used to validate lecturer shorthands during parsing.--save-intermediate: Path to save the intermediate extraction data (pickle format) and exit. Useful for skipping the slow extraction stage in subsequent runs.--load-intermediate: Path to load the intermediate extraction data from (pickle format) and skip extraction.The default values for input and output files are defined in config/constants.py.
Since the PDF extraction takes a significant amount of time, you can split the process into two stages:
./parse_class_pdf.py --save-intermediate data.pkl./parse_class_pdf.py --load-intermediate data.pkl --output classes.jsonUse this script to parse a lecturer shortname PDF into the lecturers.json file needed by the frontend. Note that if you don't merge the script output with your previous lecuturer.json file, the view of previous semesters may break. You can easily do that using jq:
jq -s 'add | unique' previous_lecturers.json script_output.json > merged.json
For more information, show the cli arguments via ./extract_lecturer_shorthands_pdf.py -h.
Rips all data files from a live modulplaner-frontend server.
For more information, show the cli arguments via ./rip_modulplaner_frontend_data.py -h.
Currently I am working on refining the core data generation. In the future, I can see myself also working on:
DSMixe entry in the room line (third line) of class pdf cells, or the line is missing altogetheralle which is degree program agnosticKontext BWL, Kontext Kommunikation, Kontext GSW have mixed classes, which arises the need the have a table to differentiate the modules based on their shorthandsteaching_type's defined that may not ever be found in class pdf'spart_of_other_classes needs to be further investigatedmodulplaner-backend is a free (as in “free speech” and also as in “free beer”) Software. It is distributed under the GNU Affero General Public License v3 (or any later version) - see the accompanying LICENSE file for more details.