This is a commandline tool used to check todays menu at all SiO restaurants. The tool should be able to handle restaurants being added/removed as long as they follow the same structure on the page.
Download the repo:
[email protected]:Eckhoff42/TerminalMenu.git
Navigate into to the file main.py
cd TerminalMenu
Run the program
python3 main.py "<restaurant name>"
# to se the list of SiO restaurants run
python3 main.py -l
# to get help use the command
python3 main.py -h
The script is written in python using BeautifulSoup
.
- The website "https://www.sio.no/mat-og-drikke/spisesteder-og-kaffebarer" is fetched
- Using BeautifulSoup the each div containing a restaurant is found.
- Name of restaurant, menu headings and menu is found for each restaurant
- The result is added to a 2d dictionary. The structure is described below
- An argparser is used to parse the user-query
result dictionary structure
{
"restaurant_1" : {"title_1" : "text_1", "title_2": "text_2"},
"restaurant_2" : {"title_3": "text_3"},
"restaurant_3" : {} //this restaurant has no menu
}