This is a Python script that converts canteen meal data from Studierendenwerk Münster XML to OpenMensa Feed v2 XML format.
Studierendenwerk Münster provides meal data as XML files, see the discussion here.
config.py
contains a few settings that you can change, the most important being output_dir
where the output data will be written to.
Install dependencies and run the script.
pip install -r requirements.txt
python parser.py
Prepare your virtual environment:
sudo pip install virtualenv
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
deactivate
Activate your virtual environment and run the parser:
source venv/bin/activate
python parser.py
deactivate
Cronjob example using virtualenv
:
Executes monday through saturday at 07:00
0 7 * * 1-6 /home/you/mensaparser/venv/bin/python /home/you/mensaparser/parser.py
Revised and parsed XML data for OpenMensa is available from mensa.chrk.de/openmensa.
I configured OpenMensa sources for Münster's canteens already, you can see a map of canteens here. Data is parsed and updated daily.
JSON data is available from the OpenMensa API via e.g. http://openmensa.org/api/v2/canteens/225/meals
.
ID 225
represents "Mensa am Ring", you can use these other IDs as well:
OpenMensa ID | Link to OpenMensa Website |
---|---|
325 |
|
227 |
Bistro Denkpause |
326 |
Bistro Durchblick |
327 |
Bistro Frieden |
872 |
Bistro Friesenring |
328 |
|
329 |
Bistro KaBu |
330 |
Bistro Katholische Hochschule |
331 |
Bistro Oeconomicum |
226 |
Mensa am Aasee |
225 |
Mensa am Ring |
233 |
Mensa Bispinghof |
228 |
Mensa da Vinci |
332 |
Mensa Steinfurt |
- Better checks for when a canteen is closed for the day
Code in this repository is licensed under the MIT license.