jmenu.api
Contains functions used to wrangle the JAMIX API. This file can be imported and exposes the following functions:
* fetch_restaurant
* parse_items
The following constants are also exposed:
* API_URL
fetch_restaurant_items(rest, fetch_date, lang_code)
Return a list of MenuItems for specified Restaurant
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rest |
Restaurant
|
dataclass containing relevant restaurant information |
required |
fetch_date |
datetime
|
datetime object used to fetch the date specified menu |
required |
lang_code |
str
|
determines the language of the response currently supports codes 'fi' and 'en' |
required |
Returns:
Type | Description |
---|---|
list[MenuItem]
|
parsed response content |
Source code in src/jmenu/api.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
|