Skip to content

slomar1/fast_nutrition

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project: "Meal-Finder-CLI" A simple command-line tool to help college students find fast-food options that meet their nutritional goals. This is the "pre-pre-alpha" version, focusing on core logic.

MVP (v0.1) Goal: Create a command-line program that lets a user define a nutritional target (e.g., "max 600 calories" or "min 30g protein") and searches a small, built-in list of food items to find matches.

v0.1 Roadmap:

[✅] Step 1: Project Setup

[✅] Step 2: Define Principle Data Structure

[✅] Step 3: Create a "Mock" Database and Hard-Code it in (Do NOT use an API yet)

[✅] Step 4: Build the Core Search Logic (Start simple: Use Basic Functions

[✅] Step 5: Build the User Interface (CLI. Use simple 'print' and 'input' statements, welcome message, menu options, error handling, etc.)


Smart Suggestion Engine (v0.2) Goal: Replace the hard-coded "mock" database with live data. Implement a more powerful search function that lets the user filter by multiple criteria at once. The app will then aggregate data from local chains via the Nutritionix API and suggest the best matches.

v0.2 Roadmap:

[ ] Step 1: Refactor Search Logic (The Master Filter)

  • Create a new file to hold your logic (filters.py)
  • Write a helper function check_constraints that takes a single food item and a dictionary of user goals and returns True only if the food passes all goals (e.g., calories < max AND protein > min).
  • Write a function filter_data that takes the full_menu_list and user_goals and loops through the list, calls check_constraints for each item, and returns the list of winners.
  • **Update menu.py by using a loop to ask the user to fill out a "profile." Pass this final dictionary to your new filter function.

[ ] Step 2: Define the Gainesville Scope (The Data Filter)

  • Create restaurants.py
  • Make a simple list of strings containing chains known to be in Gainesville and on delivery apps. Tip: Start with 5-10 reliable ones that are known to be in the Nutritionix database.

[ ] Step 3: The Aggregator (Nutritionix API Integration)

  • Create a file api_manager.py.
  • Get your API Key from Nutritionix and install the requests library: pip install requests
  • Write a function get_restaurant_menu(restaurant_name) that takes a string (e.g., "Chipotle") and make a GET request to Nutritionix: https://trackapi.nutritionix.com/v2/search/instant. This will return a JSON list of that restaurant's popular items. Crucial: Set parameters query=restaurant_name and branded=true.
  • Write a function aggregate_menus() that loops through your GAINESVILLE_CHAINS list. For every restaurant, call get_restaurant_menu. Combine all the results into one giant list (the "Session Cache"). Note: This happens live when the user searches to avoid violating "No Caching" terms (since we aren't saving to a database file).

[ ] Step 4: The Cleanup and Output

  • In main.py, take the results from Step 1 (The "Winners") and print them in a nice format that displays item name, restaurant name, nutrition stats, etc.
  • Clean house by removing sample_data.py and ensuring all 5 files (main.py, menu.py, filters.py, api_manager.py, restaurants.py) are linked and importing correctly.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages