DEV Community


Posted on

A simple terminal-based restaurant recommender system

As part of my final project for the data structures and algorithms module of the computer science path in codecademy, I have made a terminal-based recommender system for restaurants. The system is written in python3.

The food type and restaurant data set were provided by codecademy. Both food types and restaurants come as python lists.

I made the following functions:

autocomplete: This function takes lettes and a list as parameters and returns all the words from the list that contain the letters.

quicksort: This function takes a list as parameter and sorts it.

order_restaurants: This function takes the restaurant list as parameter and orders it in a dictionary

prepare_types_and_restaurants: This is a helper function sorting and ordering food types and restaurants.

print_restaurants: This function takes the restaurant dictonary as input and prints it.

print_types: This function takes a list of food types as input and formats it printable.

recommender() This is the main function handling the user inputs and the flow of the program.

Things to improve in coming versions:

  • flow optimazation
  • error handling
  • autocomplete on key press

You can get the code here:

Top comments (0)