This project simulates a food delivery service that suggests menus based on user preferences and adjusts quantities based on the number of people ordering.
The program asks for three inputs from the user:
- Total number of people ordering food.
- Whether anyone is vegetarian (Yes/No).
- Whether anyone has food allergies (Yes/No).
Based on these inputs, it generates a menu suitable for the entire group, adjusting quantities accordingly.
Next, the user is prompted to enter their city or town name. Using the Google Maps API, the program calculates the travel time from the restaurant to the customer’s location and outputs a message like:
The restaurant needs about 1 hour to prepare your order, plus you live 9 mins away (2.0 mi).
Therefore, the total delivery time is estimated at: 1 hour and 9 mins.
Finally, the project uses Matplotlib to display a pie chart showing the breakdown between food preparation time and delivery time.
This project requires a Google Maps API key to access the Distance Matrix API. For security, the API key is stored locally in a text file and read by the code.
You will need to create your own API key, save it in a text file, and update the file path in the code:
with open('/path/to/your/ApiKey.txt', 'r') as file:
api_key = file.readline()