The University I’m at provides our timetable as an excel document. It’s basically a database dump of all the lessons in the department. Sorting though it is annoying if your not using a version of office with filtering. Even with filtering I don’t find the output very appealing. Not being one to miss the opportunity to write a bit of code to do what I’m too lazy to do myself, pyTimetable was born.
pyTimetable was a simple python script which took a converted version of the document (it had to be in csv format) and parsed it to a table which is shown on the command line. The script had a variable containing the modules and all the groups that I was in (as they kept changing).
I eventually published it on a git repostory. People didn’t like it very much, the fact there was no GUI annoyed users, as did my choice of programming language (windows and python don’t go very well together). pyTimetable also had another flaw, you couldn’t just take the raw data and put it into the application. It expected csv files. The timetable raw data is subject to change, as such the application needs to be able to be easily updated by the user.
In an effort to make the application more usable for my classmates (and because the whole university uses the same format, possibly other departments in the future) I re-wrote my small timetable application as a Java application. The re-write took me two days and may not be pretty, but it works.
The core features of the application are:
- It takes the excel document without any kind of middle step,
- It persists user data (their modules and groups)
- It’s cross platform (hence Java)
- It has a GUI so that non-technical people can use it.
It doesn’t need CSV files
The main reason I used CSV files for my python application is because it was easier than having to look for an xls reader. They aren’t very easy to find, and when you do find one it’s not very usable. Apache have an xls reader for Java. I’ve found it’s usage rather mad in places but it does the job, it does it quickly, and it does it well.
It persists user data
Java provides a very nice API called the preferences API which can be used to store settings. I used this in order to make my application store the modules and the filename of the excel document.
It cross platform
Java is cross platform, which means my application is to. The libraries I’ve used have either been shiped with Java or I’ve checked they are cross platform.
It has a gui
Swing is ugly. Swing is ugly. Swing is ugly. There, I said it, none the less I used it for this project. The way in which it interacts with the models it uses is very nice, although it looks like something hit it with the ugly stick, over and over again, it’s very nice to work with.