Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pyMensa

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pyMensa

A python package for fetching mensa menus at ETH and UNI Zürich

  • 1.0.1
  • PyPI
  • Socket score

Maintainers
1

pyMensa

A python package for accessing mensa menus at ETH and UZH Zürich

Installation

pip3 install pyMensa

Usage

This package lets you access mensa menus at ETH and UZH Zürich. This package will only let you access menus at lunch time of the current day.

Get Meals

It is very simple to get meals for a mensa:

import pyMensa

meals = pyMensa.get_meals("Polymensa")

for meal in meals:
    print(meal)
    print()

Example Output:

LOCAL (STUD:10.50 STAFF:11.50 EXTERN:15.50)
	Dieses Menu servieren wir Ihnen gerne bald wieder!


STREET (STUD:9.90 STAFF:11.90 EXTERN:15.90)
	The New York Burger
	Schweizer Rindfleisch
	oder Vegi-Grillburger
	Sesam Maxi-Bun, Cheddar,
	Eisberg, Tomaten, Gurken, 
	BBQ Relish und Chips

GARDEN (STUD:6.20 STAFF:9.30 EXTERN:12.70)
	Vegan Day
	Seitan mit Blumenkohl,
	Kichererbsen und Harissa-Sauce

etc ...

Get Mensa

You can also just query for a Mensa Object:

import pyMensa

unimensa = pyMensa.get_mensa("uni")

print(unimensa.name)
print(unimensa.aliases)

meals = unimensa.get_meals()
for meal in meals:
    print(meal)
    print()

Example Output:

UZH Zentrum
['zentrum', 'uni', 'uzh zentrum', 'uzhzentrum']
einfach gut (STUD:5.40 STAFF:7.00 EXTERN:10.50)
	 Rindshackfleisch-Pilzragout
	mit hausgemachten Spätzli und Weisskabis
	Fleisch:Rind, CH


natürlich vegi (STUD:5.40 STAFF:7.00 EXTERN:10.50)
	 Gefüllte Aubergine mit Sojagehacktem Tomatensauce und Bratkartoffeln Menüsalat oder Apfelmus

Objects

This is a descripition of all objects used by this package.

Meal

This object describes a generic meal.

Parameters:

NameTypeDescription
labelstrThe label/name of that meal
price_studentstrThe price for students
price_staffstrThe price for staff
price_externstrThe price for other guests
descriptionstr arrayA list of descriptions, usually ingredients.

Functions:

NameReturn TypeDescription
strstrReturns the string representation of the meal

Mensa

This object describes a generic mensa.

Parameters:

NameTypeDescription
namestrThe name of the mensa
aliasesstr arrayA list of alternative names that can be entered when searching

Functions:

NameReturn TypeDescription
get_mealsMeal arrayReturns list of available Meals
has_aliasboolChecks if the given alias corresponds to that mensa

ETH Mensa

This object inherits from the generic Mensa object and implements the get_meals function for the ETH Gastro API

Parameters:

NameTypeDescription
api_namestrThe name of the mensa in the ETH Gastro API

Functions:

NameReturn TypeDescription
get_mealsMeal arrayFetches meals using the ETH Gastro API

UNI Mensa

This object inherits from the generic Mensa object and implements the get_meals function for the UZH Mensa Website which is unfortunately much slower that working with the proper API ETH provides us with, but we have no choice.

Parameters:

NameTypeDescription
api_namestrThe name of the mensa on the UZH Mensa Website

Functions:

NameReturn TypeDescription
get_mealsMeal arrayFetches meals from the UZH Mensa Website

Available Mensas

Here is a list of all available Mensas and their corresponding aliases:

NameAliases
Mensa Polyterrassepoly, polymensa, polyterrasse, mensa polyterrasse
Food&Labfoodlab, food lab, food&lab
Causiusbarclausius, clausiusbar, lausiusbar, lausius
Polysnackpolysnack, snack
Trailerburgerfoodtrailer, trailer, trailerburger
Alumni quattro Loungealumni, alumnilounge, alumni lounge
Bellavistabellavista, bella vista
Fusion Mealfusion, fusionmeal, fusion meal
G-ESSbargess, gessbar, g-essbar, essbar
Tannenbartanne, tannenbar, tannen bar
Dozentenfoyerdozentenfoyer, dozenten, foyer, dozenten foyer
Plattenstrasseplatte, plattestross, plattenstrasse, plattestrass
Rämi 59rämi, raemi, rämi59, raemi59, rämi 59, raemi 59, raemistrasse, rämistrasse, rämistross
UZH Mercatomercato
UZH Zentrumzentrum, uni, uzh zentrum, uzhzentrum
UZH Lichthoflichthof, rondell
UZH Irchelirchel, irchel mensa, irchelmensa
UZH Irchel Atriumirchel atrium, atrium
UZH Binzmühlebinzmühle, binzmuehle
UZH Cityportcityport
UZH Zahnmedizinzahnmedizin, zzm
UZH Tierspitaltierspital
UZH Botanischer Gartenbotanischergarten, botanischer garten, garten, botgarten

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc