Skip to content

gfranco93/stw2openmensa

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stw2openmensa

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.

Installation

Configuration

config.py contains a few settings that you can change, the most important being output_dir where the output data will be written to.

Quick start

Install dependencies and run the script.

pip install -r requirements.txt
python parser.py

Using virtualenv

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

Data access

OpenMensa Feed v2 XML format

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 format

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 Bistro Coerdehof (geschlossen)
227 Bistro Denkpause
326 Bistro Durchblick
327 Bistro Frieden
872 Bistro Friesenring
328 Bistro Hüfferstift (geschlossen)
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

Todo

  • Better checks for when a canteen is closed for the day

License

Code in this repository is licensed under the MIT license.

About

Convert canteen meal data from Studentenwerk Münster XML to OpenMensa Feed v2 XML format

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%