<jupyter_start><jupyter_text>Project Description **PLEASE NOTE THAT THIS WILL NOT WORK IN DATAHUB, ONLY ON LOCALHOST WILL CODE ACTUALLY RUN**The goal of this project is to fetch nutritional information on an item using the barcode. The project makes use of the website openfoodfacts.org, and requires a webcam of some sort. When the code is run, the computer's camera will open, and a food item can be held up to the camera and scanned. Upon being scanned, a link will open to openfoodfact.org, where everything from nutritional info to serving size to general information about the product will be displayed. The project has several real life applications. Currently, food packaging is required to show nutritional info. A program such as the one I have made would eliminate the need for this (customers could just scan with their phone or a barcode reader in a store), which would allow for less packaging and thus less waste. The website also provides ingredient information, which is important to many people but very hard to read as the font is very small on packaging. Thus, this program would allow users to open up on their phones and read ingredients clearly rather than squinting to read.  Project Code<jupyter_code>from Modules import functions as fc
def main ():
    """Combines the three functions into the main one 
    - asks the user if they want to scan a barcode, and if they do, 
    - will look for a barcode from the webcam 
    - opens the website with the nutriotional info for the barcode
    
    Parameters
    ----------
    None
     
    Returns
    -------
    nutrition_info_page: a website containing the nutrition info of the scanned food item.
    """ 
    if fc.question_input() == True:
        barcode_val = fc.get_barcodes_from_webcam()
        x = fc.get_info_from_website(barcode_val[0])
        print(x)
# run the main function
main()<jupyter_output>Would you like to scan a barcode? Type 'yes' to begin.  yes
Barcode detected. 00617536
True
{'fraction_non_alphanumeric': 0.0479313824419778, 'fraction_numerical': 0.004540867810292634, 'mean_word_length': 3.6440281030444965, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '73808', 'license': 'MIT', 'n_tokens_mistral': 523, 'n_tokens_neox': 493, 'n_words': 290, 'path': 'ProjectNotebook.ipynb', 'repo_name': 'rkhateeb/cogs18project', 'size': '1982'}