jmenu.classes
Contains dataclasses jmenu uses to manage data. This file can be imported and exposes the following classes:
* MenuItem
* Restaurant
* Marker
The following collections are use-case specific to the University of Oulu:
* MARKERS
* RESTAURANTS
* SKIPPED_ITEMS
Marker
Bases: NamedTuple
Dataclass for allergen information markings
Attributes:
Name | Type | Description |
---|---|---|
letters |
str
|
allergen markings |
explanation |
dict
|
extended information about the marker, in lang_code: explanation pairs. |
Methods:
Name | Description |
---|---|
get_explanation |
str): returns the explanation string for this Marker. Defaults to english. |
Source code in src/jmenu/classes.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
|
get_explanation(lang_code='en')
Returns the explanation in the language specified by lang_code. Defaults to english.
Source code in src/jmenu/classes.py
81 82 83 84 |
|
MenuItem
Bases: NamedTuple
Dataclass for single menu items and their properties
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
name of the dish |
diets |
[str]
|
list of allergen markers |
Methods:
Name | Description |
---|---|
diets_to_string |
returns the list of diets as a joined string. |
Source code in src/jmenu/classes.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
|
diets_to_string()
Returns the diets associated with this MenuItem as spaced string.
Source code in src/jmenu/classes.py
36 37 38 |
|
Restaurant
Bases: NamedTuple
Dataclass for relevant restaurant information
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
name of the restaurant |
client_id |
int
|
internal jamix identifier used for restaurant providers |
kitchen_id |
int
|
internal jamix identifier used to assign menu content |
menu_type |
int
|
internal jamix identifier used to classify menus based on content |
relevant_menus |
[str]
|
menu names used for filtering out desserts etc. |
Source code in src/jmenu/classes.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
|