Monday, December 21, 2015

A Python/openpyxl based timetable tool for automatically updating class, room/lab, teacher and centralized timetables taking an ERP-like input from an excel spreadsheet

A Python/openpyxl based timetable tool

1. Each row (starting from second) in the file “TT_ERP_Input1.xlsx” in “inputs” directory gives the per-event (lecture, tutorial or lab) input for preparing all the above mentioned four timetables using the four Python script files (*.py).

2. An empty row (actually, just the first cell in that row) is sensed to stop further processing of the above stated input-file.

3. The folder “templates” has templates used to prepare class, teacher, room/lab and centralized timetables.

4. The four python scripts for preparing these four timetables are in the base directory.

5. I have used Python 2.7.9 and openpyxl 2.3.2 versions. Using (Open Source) Linux Mint 17.2. However, it is well known that all these tools work just as fine on any other operating system or distribution. LibreOffice was used as the spreadsheet s/w.

6. Each python-script may be run at command prompt as:

$ python

or, inside the ipython shell (recommended) as:

In [1]: execfile('')

Based on the contents of file (inputs/TT_ERP_Input1.xlsx), the exact number of "Class_*.xlsx" files are created in the current folder. Same for the other three “*.py” script-files (Of course, the script "" creates only one "Centralized.xlsx"). A clash in each of these four types of timetables is highlighted by the corresponding cell filled red.

7. The zip-file “” has all the four script files, templates etc. with proper directory structure.

Feel free to communicate suggestions, comment,s etc. and to make your own modifications etc.

Happy timetabling !!!!!

No comments:

Post a Comment