Prathamesh Sable commited on
Commit
b5edbe6
·
1 Parent(s): 7e333d7

data and integration updates

Browse files
Files changed (5) hide show
  1. README.md +33 -15
  2. data/Food_Aditives_E_numbers.csv +349 -0
  3. logger_manager.py +44 -0
  4. main.py +6 -10
  5. requirements.txt +130 -6
README.md CHANGED
@@ -43,28 +43,46 @@
43
  ## API Endpoints
44
 
45
  ### Authentication
46
- - `POST /api/register`: Register a new user.
47
- - `POST /api/login`: Login and obtain an access token.
48
- - `GET /api/users/me`: Get the current user's information.
49
 
50
  ### Ingredient Analysis
51
- - `POST /api/analyze_ingredients`: Analyze a list of ingredients.
52
- - `GET /api/personalized_recommendations`: Get personalized ingredient recommendations.
53
 
54
  ### Scan History
55
- - `POST /api/scan`: Record a new scan.
56
- - `GET /api/history/{user_id}`: Retrieve the scan history for a user.
57
 
58
- ### Product Data
59
  - `GET /api/extract_product_info`: Extract product information from a barcode.
60
- - `POST /api/fetch_product_data`: Fetch product data for a list of barcodes.
61
 
62
- ## Environment Variables
63
 
64
- ### Hugging Face Transformers API key
65
- Obtain a free API key from Hugging Face by signing up on their website. Add the API key to the `.env` file with the variable name `HUGGING_FACE_API_KEY`.
66
 
67
- Example:
68
- ```env
69
- HUGGING_FACE_API_KEY=your_api_key_here # Get your API key from https://huggingface.co
70
  ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  ## API Endpoints
44
 
45
  ### Authentication
46
+ - `POST /api/auth/register`: Register a new user.
47
+ - `POST /api/auth/login`: Login and obtain an access token.
48
+ - `GET /api/auth/user`: Get the current user's information.
49
 
50
  ### Ingredient Analysis
51
+ - `POST /api/analyze/analyze_ingredients`: Analyze a list of ingredients.
52
+ - `GET /api/analyze/personalized_recommendations`: Get personalized ingredient recommendations.
53
 
54
  ### Scan History
55
+ - `POST /api/history/scan`: Record a new scan.
56
+ - `GET /api/history/scan/{user_id}`: Retrieve the scan history for a user.
57
 
58
+ <!-- ### Product Data
59
  - `GET /api/extract_product_info`: Extract product information from a barcode.
60
+ - `POST /api/fetch_product_data`: Fetch product data for a list of barcodes. -->
61
 
 
62
 
63
+ ## Alembic migrations
 
64
 
65
+ ### To create a new migration, run the following command:
66
+ ```bash
67
+ alembic init migrations
68
  ```
69
+
70
+ ### To generate a new migration file, run:
71
+ ```bash
72
+ alembic revision --autogenerate -m "Message"
73
+ ```
74
+
75
+ ### To apply the migration, run:
76
+ ```bash
77
+ alembic upgrade head
78
+ ```
79
+
80
+ ### To downgrade the migration, run:
81
+ ```bash
82
+ alembic downgrade -1
83
+ ```
84
+
85
+ ### To view the current migration version, run:
86
+ ```bash
87
+ alembic current
88
+ ```
data/Food_Aditives_E_numbers.csv ADDED
@@ -0,0 +1,349 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ E Numbers,Name of Aditive,Description,Example Use
2
+ E100,Curcumin,Naturally occurring orange/yellow colour Extracted from the spice turmeric,"Used in pastries, confectionery, sauces, and soups"
3
+ E101,Riboflavin or lactoflavin (Vitamin B2),Naturally occurring B-group vitamin Usually obtained from yeast or produced synthetically,Enrichment and fortification of food Added to processed cheese as yellow/orange colour
4
+ E102,Tartrazine,Widely used yellow/orange colour,"Found in soft drinks, cakes, biscuits, puddings, meat products, sauces, tinned and packet convenience foods and confectionery"
5
+ E104,Quinoline Yellow,"A synthetic coal tar dye, greenish yellow in colour","Used with other yellow colours, especially in smoked fish"
6
+ E110,Sunset Yellow FCF; Orange Yellow S,"A synthetic coal tar dye, yellow in colour, used with E102","Found in soft drinks, cakes, biscuits, puddings, meat products, sauces, tinned and packet convenience foods and confectionery"
7
+ E120,Cochineal; Carminic acid; Carmines,Natural red colour obtained from egg yolk and dried insects Can be manufactured,Red colour in foods
8
+ E122,Azorubine; Carmoisine,"A synthetic coal tar dye, red/purple in colour","Often added to raspberry and chocolate flavoured desserts, marzipan, jam, cherryade, bottled sauce, and breaded products"
9
+ E123,Amaranth,"A synthetic coal tar dye, red in colour","Sometimes used in gravy mixes, meat patties, and blackcurrant drinks"
10
+ E124,Ponceau 4R; Cochineal Red A,"A synthetic coal tar dye, red in colour","Often used to restore red colour to tinned strawberries Also added to strawberry jam, jelly and ice cream, tomato soup, savoury rice, cheesecake mix, and some meat products"
11
+ E127,Erythrosine,"A synthetic coal tar dye, red in colour Rich in mineral iodine","Regular component of glace cherries, peach melba yogurt, vacuum-packed ham and pork, tinned strawberries, and certain flavours of chips and potato-based snacks"
12
+ E128,Red 2G,"A synthetic coal tar dye, red in colour",Now banned in many countries including the EU and USA
13
+ E129,Allura Red AC,Colouring agent,"Used in drinks, baked goods, meat products, and sweets"
14
+ E131,Patent Blue V,Colouring agent,Used in some meat products
15
+ E132,lndigotine; Indigo Carmine,"A synthetic coal tar dye, blue in colour",Added to gravy mix and certain meat products
16
+ E133,Brilliant Blue FCF,"A synthetic coal tar dye, blue in colour Often mixed with E102 to make green",Bacon flavoured snacks
17
+ E140,Chlorophyll and chlorophyllins,Naturally occurring green pigment found plant leaves and stems Also manufactured,Added to green vegetables to enhance their colour
18
+ E141,Copper complexes of chlorophyll and chlorophyllins,A more stable colour obtained by a reaction between copper and manufactured chlorophyll,Used to heighten the green colour of products such as cucumber relish
19
+ E142,Green S,"A synthetic coal tar dye, green in colour","Used to restore the expected green colour to tinned peas Also added to asparagus soup, lemon or lime drinks and jellies, and mint sauce"
20
+ E150a,Plain caramel,Commonly used brown colour and flavouring agent made from the caramelisation or burning of sugar by heat or chemicals No ammonium or sulphite reactants,"Used in soft drinks, gravy mix, brown bread, cakes, biscuits, malt vinegar, marmalade, and beef products"
21
+ E150b,Caustic sulphite caramel,"Colouring agent With sulphite reactant, but no ammonium","Used in tea, whiskey, and brandy"
22
+ E150c,Ammonia caramel,"Colouring agent With ammonium reactant, but no sulphite",Used to colour soy sauce and beer
23
+ E150d,Sulphite ammonia caramel,Colouring agent With both sulphite and ammonia reactants,Widely used for soft drinks
24
+ E151,Brilliant Black BN; Black PN,"A synthetic coal tar dye, black in colour",Used to darken fruit sauces
25
+ E153,Vegetable carbon,"Natural black colour obtained from burnt plant material, now often manufactured","Added to concentrated fruit juices, preserves, and jellies"
26
+ E155,Brown HT,"A synthetic coal tar dye, brown in colour",Various foods
27
+ E160 a e,Carotenoids,"Plant pigments derived from carrots, tomatoes, apricots, oranges, rosehip and green leafy vegetables Now mostly manufactured",Provide a range of colours from yellow to red
28
+ E160a,"Alpha-, beta, and gamma-carotenes",Beta-carotene is a well-known substance that is converted by the body to Vitamin A Orange in colour,"Added to biscuits, cakes, margarine, creamed rice, cheese products, and certain soups"
29
+ E160b,Annatto,Orange/peach pigment naturally present in butter and cheese,"Used to give creamy colour to creamed rice, coffee creamer, pastry, cheese, and cheese products"
30
+ E160c,Paprika extract; Capsanthian; Capsorubin,Colouring agent (red),Can be used to add colour and flavour to various food products
31
+ E160d,Lycopene,Colouring agent (red) Carotenoid,"May be used in processed foods, beverages, and ketchup"
32
+ E160e,Beta-apo-8'-carotenal (C30); apocarotenal,Colouring agent (orange/red) Carotenoid,Sometimes used in processed cheese
33
+ E161b,Lutein,Colouring agent (yellow/orange) Carotenoid,Has been used as a chicken feed additive to promote yellow colouring of egg yolks
34
+ E161g,Canthaxanthin,Colouring agent (reddish/orange) Carotenoid,May be present in food and self-tanning products
35
+ E162,Betanin (Beetroot Red),Naturally occurring red/purple colour in beetroots,May be added to oxtail soup
36
+ E163,Anthocyanins,Plant pigments with colours ranging from red to blue Naturally present in red cabbage and grapes,"Used in producing purple-colored beverages, confectionaries, and jams"
37
+ E170,Calcium carbonate (chalk),Naturally occurring mineral,"Various functions including acid regulator, firming agent, releasing agent, and nutrient Added to white flour as a calcium supplement to replace the loss due to refining Frequently an ingredient in bread and baked products"
38
+ E171,Titanium dioxide,Colouring agent,Use no longer permitted in the EU and in Northern Ireland as of Feb 2022
39
+ E172,Iron oxides and hydroxides,Naturally occurring mineral,Added to fortify food Added to flour and breakfast cereals
40
+ E173,Aluminium,Colouring agent (silver/grey),"Surface coating (eg, for cake decoration or confectionary)"
41
+ E174,Silver,Colouring agent,May be used for silver surface coating
42
+ E175,Gold,Colouring agent,May be used for gold surface coating
43
+ E180,Lithol rubine BK,Colouring agent (red),Used for colouring cheese rind
44
+ E200,Sorbic acid,Naturally occurring in some fruit but generally manufactured synthetically for use as a food preservative,"Commonly added to soft drinks, cheese spread, frozen pizza, and cakes"
45
+ E202,Potassium sorbate,Salt of sorbic acid,Used to preserve glace cherries
46
+ E210,Benzoic acid,"Occurs naturally in cherry bark, raspberries, tea, anise, and cassia bark, but largely prepared synthetically for commercial use","Acts as a preservative and antioxidant most frequently in fruit products, soft drinks, pickled produce, and salad dressings"
47
+ E211,Sodium benzoate,Salt of benzoic acid,In bottled sauces
48
+ E212,Potassium benzoate,Salt of benzoic acid,As per benzoic acid (E210)
49
+ E213,Calcium benzoate,Salt of benzoic acid,As per benzoic acid (E210)
50
+ E214,Ethyl p-hydroxybenzoate,Preservative Salt of benzoic acid,As per benzoic acid (E210)
51
+ E215,Sodium ethyl p-hydroxybenzoate,Preservative Salt of benzoic acid,As per benzoic acid (E210)
52
+ E218,Methyl p-hydroxybenzoate,Preservative Salt of benzoic acid,As per benzoic acid (E210)
53
+ E219,Sodium methyl p-hydroxybenzoate,Preservative Salt of benzoic acid,As per benzoic acid (E210)
54
+ E220,Sulfur dioxide,"Gas prepared chemically for use as a food preservative, flour improver, bleaching agent, and Vitamin C stabiliser","Found in carbonated drinks, marmalade, glace cherries, mixed peel, cakes, fruit based products, and meat products"
55
+ E221,Sodium sulphite,Preservative,May be used to prevent discolouration in dried fruit
56
+ E222,Sodium hydrogen sulphite,Synthetic preservative and bleaching agent,Often added to wine and beer
57
+ E223,Sodium metabisulphite,Synthetic preservative,Added to sausages and some bottled sauces
58
+ E224,Potassium metabisulphite,Preservative,"Sometimes used to preserve beer, wine, and other fermented beverages"
59
+ E226,Calcium sulphite,Preservative,Banned in Australia
60
+ E227,Calcium hydrogen sulphite,Preservative,May be used in canned fruit and beer products
61
+ E228,Potassium hydrogen sulphite,Preservative,May be used in alcoholic beverages
62
+ E234,Nisin,Preservative,Cheese and dairy products
63
+ E235,Natamycin,Preservative,Cheese and sausages
64
+ E239,Hexamethylene tetramine,Preservative,Cheese and fish products
65
+ E242,Dimethyl dicarbonate,Preservative,Beverages
66
+ E243,Ethyl lauroyl arginate,Preservative,Heat‐treated meat products
67
+ E249,Potassium nitrite,Naturally occurring mineral used as a preservative and colour fixative,"Used in cooked meats, sausages, and cured meats"
68
+ E250,Sodium nitrite,Derived from sodium nitrate by chemical or bacterial action Acts as a preservative and colour fixative,"Added to cooked and cured meats, bacon, and pork sausages"
69
+ E251,Sodium nitrate,"Naturally occurring mineral, usually manufactured synthetically for use as a food preservative and colour fixative","In cooked meats, bacon, ham, and cheese"
70
+ E252,Potassium nitrate,Naturally occurring but more usually produced artificially from animal waste and vegetable material One of the oldest and most effective preservatives for meat Also acts as a curing agent,"Found in cured and cooked meats, and sausages"
71
+ E280,Propionic acid,"Fatty acid produced by animals in the process of digestion, but generally manufactured synthetically",Added to baked goods Functions as a preservative
72
+ E281,Sodium propionate,Salt of propionic acid,Added to baked goods
73
+ E282,Calcium propionate,Salt of propionic acid Found naturally in Swiss cheese,Added to baked goods
74
+ E283,Potassium propionate,Salt of propionic acid,Added to baked goods
75
+ E284,Boric acid,Preservative and acidity regulator,"Sometimes used in meat, fish, and dairy products Other uses include antiseptic and insecticide"
76
+ E285,Sodium tetraborate; borax,Preservative Sodium salt of boric acid (see E284),Sometimes used as caviar preservative Banned in some countries including the United States
77
+ E1105,Lysozyme,"Preservative Natural enzyme found in tears,��saliva, blood, sweat, and breast milk Commercially purified from egg whites",Infant nutrition products Cheese products
78
+ E300,Ascorbic acid (Vitamin C),"Occurs naturally in fruit and vegetables but is synthesised biologically Acts as a preservative, anti-oxidant, meat colour fixative, and flour improver Also a vitamin","Found in fruit juices, bread, baked products, powdered mashed potatoes, and other products"
79
+ E301,Sodium ascorbate,Salt of ascorbic acid,Added to cured meats
80
+ E302,Calcium ascorbate,Salt of ascorbic acid,Similar function to ascorbic acid (E300)
81
+ E304,Fatty acid esters of ascorbic acid,Salt of ascorbic acid,Used in sausage and cured meats
82
+ E306,Tocopherol (Vitamin E),"Obtained from soya bean oil, wheatgerm, rice germ, cottonseed, maize, and green leaves Used as an antioxidant and nutrient",Added to fats and oils
83
+ E307,Alpha-tocopherol,Synthetic products of tocopherol with similar functions (see E306),Added to fats and oils
84
+ E308,Gamma-tocopherol,Synthetic products of tocopherol with similar functions (see E306),Added to fats and oils
85
+ E309,Delta-tocopherol,Synthetic products of tocopherol with similar functions (see E306),Added to fats and oils
86
+ E310,Propyl gallate,Synthetically prepared antioxidant,Added to fats and oils Found in fried foods May give rise to a bitter taste
87
+ E315,Erythorbic acid,Antioxidant,Processed meat and fish products
88
+ E316,Sodium erythorbate,Antioxidant,Meat products
89
+ E319,Tertiary-butyl hydroquinone (TBHQ),Antioxidant,Fats and oils
90
+ E320,Butylated hydroxyanisole (BHA),"Antioxidant manufactured synthetically for use alone or with E280, E310, or E330","Often found in chips and other potato snacks, biscuits, pastry, bottled sauces, and fried foods"
91
+ E321,Butylated hydroxytoluene (BHT),Synthetically prepared antioxidant,Similar to butylated hydroxyanisole (E320)
92
+ E392,Extracts of rosemary,Antioxidant,Fat-based spreads
93
+ E586,4-Hexylresorcinol,Antioxidant,Shrimps and crustaceans
94
+ E420,Sorbitol,Sugar alcohol produced from glucose Less quickly absorbed than sugar so often used as a sweetener Also used as a humectant and food colour diluent May have a laxative effect in large doses,"Widely used in diabetic confectionery, preserves, biscuits, cakes, and soft drinks"
95
+ E421,Mannitol,"Sugar alcohol derived from mannose, but general manufactured from seaweed Acts as a sweetener, emulsifier, anti-caking agent, and thickener",Used in confectionery and desserts
96
+ E950,Acesulfame K,Sweetener,Low-calorie sweetener used in various food and drinks
97
+ E951,Aspartame,New artificial sweetener of protein origin Contains phenylalanine,"Artificial sweeteners, confectionery, ice cream, low calorie desserts, and soft drinks"
98
+ E952,Cyclamic acid and its Na and Ca salts,Artificial sweetener,
99
+ E953,lsomalt,Sweetener High temperature stability,"Used as a sweetener in heat-treated products eg, bakery products"
100
+ E954,"Saccharin and its Na, K, and Ca salts",Calorie-free artificial sweetener,"Low calorie products, soft drinks, and confectionery"
101
+ E955,Sucralose,Sweetener,"Candy, breakfast bars, soft drinks, canned fruits"
102
+ E957,Thaumatin,Sweetener Natural plant protein,"May be used in beverages, dairy products, or chewing gum"
103
+ E959,Neohesperidine DC,Sweetener Derived from citrus,"Widely used in desserts, dairy products, confectionary, and beverages"
104
+ E960,Steviol glycoside,Sweetener,"Widely used in carbonated soft drinks, juice, tea, desserts, dairy products, confectionary, and other products"
105
+ E961,Neotame,"Sweetener, similar to aspartame (E951)",Widely used (see E951)
106
+ E962,Salt of aspartame-acesulfame,Low-calorie sweetener,
107
+ E964,Polyglycitol syrup,Sweetener,
108
+ E965,Maltitol,Naturally occurring sugar in grapes and corn,"Confectionery, cakes, biscuits, puddings, desserts, soft drinks, convenience foods"
109
+ E966,Lactitol,Synthetic sweetener Derived from lactose,Replacement bulk sweetener for low-calorie foods
110
+ E967,Xylitol,Sweetener,"Widely used as sugar substitute eg, confectionary, sweet sauces, liqueurs, jams, desserts"
111
+ E968,Erythritol,Sweetener Made from carbohydrate fermentation,
112
+ E969,Advantame,Sweetener,"Tabletop sweetener, confectionary, bubblegum, flavoured drinks, and other products"
113
+ E322,Lecithins,"Type of fat or lipid compound found naturally in all living organisms, protective against cholesterol deposition Egg yolk is a rich source of lecithins, but commercially, most is obtained from soya beans Used as an antioxidant and emulsifier","Found in chocolate and chocolate products, powdered milk, margarine, and potato snacks"
114
+ E400,Alginic acid,"Emulsifier, stabiliser, gelling agent, and thickener extracted from brown seaweed","Frequently added to ice cream, instant desserts, and puddings"
115
+ E401,Sodium alginate,Salt of alginic acid with similar functions (see E400),See E400 (alginic acid)
116
+ E402,Potassium alginate,Salt of alginic acid with similar functions (see E400),See E400 (alginic acid)
117
+ E403,Ammonium alginate,Salt of alginic acid with similar functions (see E400),See E400 (alginic acid)
118
+ E404,Calcium alginate,Salt of alginic acid with similar functions (see E400),See E400 (alginic acid)
119
+ E405,"Propane-1,2-diol alginate; propylene glycol alginate (PGA)","Emulsifier, stabiliser, thickener, and gelling agent Ester made from alginic acid (E400) and [propylene glycol](/topics/contact-allergy-to-propylene-glycol) (E1520)",
120
+ E406,Agar,Naturally occurring gum extracted from seaweeds Not digested so acts a source of dietary fibre Also acts as a stabiliser and gelling agent,"Used in tinned ham, meat glazes, and in ice cream"
121
+ E407,Carrageenan (Irish moss),"Gum naturally present in red seaweed Used as an emulsifier, stabiliser, and gelling agent",Found in ice cream Alternative to gelatin
122
+ E407a,Processed eucheuma seaweed,"Emulsifier, stabiliser, thickener, and gelling agent",
123
+ E410,Locust bean gum; carob gum,Natural extract from the Carob tree seed Similar to E407,"Added to ice cream, and soups Carob is a non-caffeine containing substitute for cocoa and chocolate Used in beverages, confectionery, and baked products"
124
+ E412,Guar gum (cluster bean gum),Naturally occurring seed gum from a tree of the pea family Used as a thickener and stabiliser,"Added to bottled sauces, soup, ice cream, and frozen desserts"
125
+ E413,Tragacanth,"Natural gum obtained from a tree of the pea family Used as a stabiliser, emulsifier, and thickener Used to prevent crystallisation of sugar",Similar to E412 and in confectionery
126
+ E414,Acacia gum; gum arabic,Similar to E413,Similar to E413
127
+ E415,Xanthan gum,"Made from fermentation of carbohydrates by bacteria Used as an emulsifier, stabiliser, and thickener",Added to ice cream and bottled sauces
128
+ E416,Karaya gum,"Emulsifier, stabiliser, thickener, and gelling agent",
129
+ E417,Tara gum,"Emulsifier, stabiliser, thickener, and gelling agent",
130
+ E418,Gellan gum,"Emulsifier, stabiliser, thickener, and gelling agent",
131
+ E425,Konjac,"Emulsifier, stabiliser, thickener, and gelling agent",
132
+ E426,Soybean hemicellulose,"Emulsifier, stabiliser, thickener, and gelling agent",
133
+ E427,Cassia gum,"Emulsifier, stabiliser, thickener, and gelling agent",
134
+ E432,Polyoxyethylene sorbitan monolaurate; Polysorbate 20,"Emulsifier, stabiliser, thickener, and gelling agent",
135
+ E433,Polyoxyethylene sorbitan mono-oleate; Polysorbate 80,"Emulsifier, stabiliser, thickener, and gelling agent",
136
+ E434,Polyoxyethylene sorbitan monopalmitate; Polysorbate 40,"Emulsifier, stabiliser, thickener, and gelling agent",
137
+ E435,Polyoxyethylene sorbitan monostearate; Polysorbate 60,"Emulsifier, stabiliser, thickener, and gelling agent Prepared from sorbitol (E420)",Bread and baked products
138
+ E436,Polyoxyethylene sorbitan tristearate; Polysorbate 65,"Emulsifier, stabiliser, thickener, and gelling agent",
139
+ E440a,Pectin,"Occurs naturally in fruits, roots, and stems of plants","Used as a stabiliser and gelling agent Added to preserves, jellies, and mint sauce"
140
+ E440b,Amidated pectin,Chemically treated pectin used as an emulsifier and gelling agent,Preserves and jellies
141
+ E442,Ammonium phosphatide,"Emulsifier, stabiliser, thickener, and gelling agent",
142
+ E444,Sucrose acetate isobutyrate,"Emulsifier, stabiliser, thickener, and gelling agent",
143
+ E445,Glycerol esters of wood rosins,"Emulsifier, stabiliser, thickeners, and gelling agent",
144
+ E460,Cellulose,Fibrous part of plant cell walls used as a bulking agent,Used in high fibre bread and low-calorie products
145
+ E461,Methyl cellulose,Derived from cellulose with similar properties,Used in slimming foods
146
+ E462,Ethyl cellulose,"Emulsifier, stabiliser, thickener, and gelling agent",
147
+ E463,Hydroxypropyl cellulose,"Emulsifier, stabiliser, thickener, and gelling agent",
148
+ E464,Hydroxypropyl methyl cellulose,"Emulsifier, stabiliser, thickener, and gelling agent",
149
+ E465,Ethyl methyl cellulose,Derived from cellulose with similar properties,Added to fruit cake and bottled sauces
150
+ E466,Carboxymethyl cellulose,Derived from cellulose with similar properties,"Used in ice cream, cream products, and cheesecake mix"
151
+ E468,Crosslinked sodium carboxymethyl cellulose,"Emulsifier, stabiliser, thickener, and gelling agent",
152
+ E469,Enzymatically hydrolysed carboxymethyl cellulose,"Emulsifier, stabiliser, thickener, and gelling agent",
153
+ E470a,"Sodium, potassium, and calcium salts of fatty acids","Synthetically manufactured emulsifiers, stabilisers, and anti-caking agents",Crisps and potato snacks
154
+ E470b,Magnesium salts of fatty acids,"Emulsifiers, stabilisers, thickeners, and gelling agents",
155
+ E471,Monoand diglycerides of fatty acids,Normal products of fat digestion but are prepared synthetically,"Frequently added to powdered milk, packet soup, cake, crisps, potato snacks, bread, baked products, and margarine"
156
+ E472a,Acetic acid esters of monoand diglycerides of fatty acids,"Emulsifiers, stabilisers, thickeners, and gelling agents",
157
+ E472b,Lactic acid esters of monoand diglycerides of fatty acids,"Emulsifiers, stabilisers, thickeners, and gelling agents",
158
+ E472c,Citric acid esters of monoand diglycerides of fatty acids,"Emulsifiers, stabilisers, thickeners, and gelling agents",
159
+ E472d,Tartaric acid esters of monoand diglycerides of fatty acids,"Emulsifiers, stabilisers, thickeners, and gelling agents",
160
+ E472e,Monoand diacetyltartaric acid esters of monoand diglycerides of fatty acids,"Emulsifiers, stabilisers, thickeners, and gelling agents",
161
+ E472f,Mixed acetic and tartaric acid esters of monoand diglycerides of fatty acids,"Emulsifiers, stabilisers, thickeners, and gelling agents",
162
+ E473,Sucrose esters of fatty acids,"Emulsifiers, stabilisers, thickeners, and gelling agents",
163
+ E474,Sucroglycerides,"Emulsifiers, stabilisers, thickeners, and gelling agents",
164
+ E475,Polyglycerol esters of fatty acids,Synthetic product of E471 used as an emulsifier and stabiliser,Puddings and packet cheesecakes
165
+ E476,Polyglycerol polyricinoleate,"Emulsifiers, stabilisers, thickeners, and gelling agents",
166
+ E477,"Propane-1,2-diol esters of fatty acids","Emulsifiers, stabilisers, thickeners, and gelling agents",
167
+ E479b,Thermally oxidised soya bean oil interacted with monoand diglycerides of fatty acids,"Emulsifier, stabiliser, thickener, and gelling agent",
168
+ E481,Sodium stearoyl-2-lactylate,Prepared synthetically from lactic acid Used as a stabiliser and emulsifier,Potato snacks
169
+ E482,Calcium stearoyl-2-lactylate,"Emulsifier, stabiliser, thickener, and gelling agent",
170
+ E483,Stearyl tartrate,"Emulsifier, stabiliser, thickener, and gelling agent",
171
+ E491,Sorbitan monostearate,"Emulsifier, stabiliser, thickener, and gelling agent",
172
+ E492,Sorbitan tristearate,"Emulsifier, stabiliser, thickener, and gelling agent",
173
+ E493,Sorbitan monolaurate,"Emulsifier, stabiliser, thickener, and gelling agent",
174
+ E494,Sorbitan monooleate,"Emulsifier, stabiliser, thickener, and gelling agent",
175
+ E495,Sorbitan monopalmitate,"Emulsifier, stabiliser, thickener, and gelling agent",
176
+ E1103,Invertase,"Emulsifier, stabiliser, thickener, and gelling agent",
177
+ E260,Acetic acid,"Natural component of vinegar but generally manufactured from wood Used as a preservative, acid, or colour diluent","Found in pickles, bottled sauces, and chutneys"
178
+ E261,Potassium acetate,"Flavour agent, preservative, and acidity regulator Potassium salt of acetic acid (E260)",Used as flavouring agent in snack foods such as potato chips (vinegar taste) Also used in potassium supplements
179
+ E262,Sodium acetate,"Flavouring agent, preservative, and acid Sodium salt of acetic acid (E260)","Salt and vinegar chip flavouring, among other uses"
180
+ E263,Calcium acetate,"Flavouring agent, preservative, and acid Calcium salt of acetic acid (E260)",
181
+ E270,Lactic acid,"Produced by the fermentation of lactose (the sugar present in milk) Occurs naturally in soured milk and yoghurt Acts as a preservative, acid, flavour, and assists the action of antioxidants","Widely used in salad dressings, cakes, biscuits, confectionery, and certain types of prepared meat dishes"
182
+ E290,Carbon dioxide,"Gas present in air, but produced synthetically for food Adds the fizz to fizzy drinks (carbonation) Also used as a coolant, freezant, propellant, preservative, and packaging gas",Carbonated drinks
183
+ E296,Malic acid,"Flavouring agent, acidity regulator, colour stabiliser",
184
+ E297,Fumaric acid,Prepared synthetically as an acid flavour,Baked products
185
+ E325,Sodium lactate,"Preservative, acidity regulator, and bulking agent",
186
+ E326,Potassium lactate,Preservative,Meat and poultry products
187
+ E327,Calcium lactate,"Firming agent, flavouring agent, thickener, stabiliser, antioxidant",Used in fruit and vegetable processing May be used in calcium supplements
188
+ E330,Citric acid; lemon salt,"Acidity regulator, preservative","Commonly used in canned foods, snacks, ice creams, soft drinks"
189
+ E331,Sodium citrates,"Preservatives, flavouring agents, emulsifiers Sodium salt of citric acid (E330)",
190
+ E332,Potassium citrates,"Acidity regulators, flavouring agents Potassium salt of citric acid (E330)","As well as food additive, may be used to treat kidney stones"
191
+ E333,Calcium citrates,"Preservatives, flavouring agents Calcium salt of citric acid (E330)","As well as food additive, sometimes used in calcium supplements"
192
+ E334,Tartaric acid (L-(+)),"Acidity regulator, flavouring agent, raising agent, stabiliser","Sugar production, confectionary, winemaking"
193
+ E335,Sodium tartrates,"Acidity regulators, stabilisers Sodium salts of tartaric acid (E334)","Binding agent in jellies, margarine, and sausage casings"
194
+ E336,Potassium tartrates,"Acidity regulators, stabilisers Potassium salts of tartaric acid (E334) Potassium bitartrate = cream of tartar",
195
+ E337,Sodium potassium tartrates,"Acidity regulators, stabilisers Double salts of tartaric acid",
196
+ E338,Phosphoric acid,"Acid, flavouring","Soft drinks, jams"
197
+ E339,Sodium phosphates,"Acidity regulator, thickener, emulsifier Sodium salt of phosphoric acid (E338)","Found in meat, cheese, and baked products"
198
+ E340,Potassium phosphates,"Acidity regulator, raising agent, stabiliser Potassium salt of phosphoric acid (E338)","As well as food additive, also used in some potassium supplements"
199
+ E341,Calcium phosphates,"Anti-caking agent, emulsifier, stabiliser, acidity regulator Calcium salt of phosphoric acid (E338)",Used to prevent lumps in powdered foods Also used in some nutritional supplements
200
+ E343,Magnesium phosphates,"Acidity regulator, anti-caking agent, stabiliser",Found in salt substitutes
201
+ E350,Sodium malate,"Acidity regulator, flavouring agent Sodium salt of malic acid (E296)",
202
+ E351,Potassium malate,"Acidity regulator, antioxidant, flavouring agent Potassium salt of malic acid (E296)",
203
+ E352,Calcium malate,"Acidity regulator, flavouring agent, thickening agent Calcium salt of malic acid (E296)",
204
+ E353,Metatartaric acid,Acidity regulator,Used in wine production
205
+ E354,Calcium tartrate,Preservative and acidity regulator Calcium salt of tartaric acid (E334),
206
+ E355,Adipic acid,"Acidity regulator, flavouring and raising agent Naturally present in beets and sugar cane","Used in baking powders, fizzy drinks, and drink mixes"
207
+ E356,Sodium adipate,Sodium salt of adipic acid,
208
+ E357,Potassium adipate,Potassium salt of adipic acid,
209
+ E363,Succinic acid,"Acidity regulator, flavouring, fragrance",
210
+ E380,Triammonium citrate,"Acid regulator, buffer, emulsifier Ammonium salt of citric acid",
211
+ E385,Calcium disodium ethylene diamine tetra-acetate; calcium disodium EDTA,"Preservative, antioxidant","Canned foods, soft drinks"
212
+ E422,Glycerol,"Flavour enhancer, sweetener, colouring agent, preservative",Widely used in baked goods and confectionary
213
+ E423,Octenyl succinic acid modified gum arabic,Emulsifier Chemical modification of gum arabic,"Processed meat, cheeses, jam, snacks, chewing gum"
214
+ E450,Diphosphates,"Acid regulators, emulsifiers Salts of sodium / potassium / calcium with phosphates",Many different products
215
+ E451,Triphosphates,"Preservatives, emulsifiers, stabilisers Potassium and sodium triphosphates",Many different products
216
+ E452,Polyphosphates,"Stabilisers, emulsifiers Polyphosphates of potassium, calcium, ammonium, sodium",Many different products
217
+ E459,Beta-cyclodextrin; betadex,"Emulsifier, flavouring agent","Dry mixes (eg, for baking, soups, flavoured coffee or tea), cereal, other processed products"
218
+ E499,Stigmasterol-rich plant sterols,,
219
+ E500,Sodium carbonate,"Acidity regulator, anti-caking agent, raising agent, stabiliser",
220
+ E501,Potassium carbonate,"Acidity regulator, stabiliser, raising agent",Baking Can be used in potassium supplements
221
+ E503,Ammonium carbonate,"Acidity regulator, stabiliser, leavening agent","Flat-baked goods (eg, crackers, cookies)"
222
+ E504,Magnesium carbonate,"Acidity regulator, colouring agent, anti-caking agent May have laxative effect in high concentrations","Salts, icing sugar, dry mixes Dietary supplements (source of magnesium)"
223
+ E507,Hydrochloric acid,Acidity regulator,Syrup production
224
+ E508,Potassium chloride,"Flavouring agent, thickener",Sodium-free salt alternative
225
+ E509,Calcium chloride,"Preservative, stabiliser, firming agent, anti-caking agent, acid regulator","Various food products, also used in some calcium supplements"
226
+ E511,Magnesium chloride,"Stabiliser, firming agent",Tofu preparation from soy milk
227
+ E512,Stannous chloride,"Antioxidant, colour retention agent",Canned and bottled foods
228
+ E513,Sulphuric acid,Acidity regulator,Beer preparation and dairy products
229
+ E514,Sodium sulphate,"Acidity regulator, anti-caking agent, stabiliser Sodium salt of sulphuric acid","Beer, biscuits, confectionary, chewing gum"
230
+ E515,Potassium sulphate,"Acid regulator, anti-caking agent Potassium salt of sulphuric acid",Salt substitute Beer production
231
+ E516,Calcium sulphate,"Buffer, firming agent Calcium salt of sulphuric acid","Soy products, tofu"
232
+ E517,Ammonium sulphate,Acidity regulator Ammonium salt of sulphuric acid,"Used in dough, baked products"
233
+ E520,Aluminium sulphate,Aluminium salt of sulphuric acid,Beer brewing
234
+ E521,Aluminium sodium sulphate,"Acidity regulator, bleaching agent","Flour, cheese, confectionary"
235
+ E522,Aluminium potassium sulphate,"Acidity regulator, raising agent",Baking products
236
+ E523,Aluminium ammonium sulphate,"Acidity regulator, stabiliser",Baking products
237
+ E524,Sodium hydroxide,Acidity regulator,"Baking, and chocolate, cocoa, fruit, and olive processing"
238
+ E525,Potassium hydroxide,"Acidity regulator, stabiliser, thickening agent",
239
+ E526,Calcium hydroxide,"Acidity regulator, preservative",Beer production Pretzel glazing Vegetable processing
240
+ E527,Ammonium hydroxide,Acidity regulator,Baked goods Confectionary Puddings
241
+ E528,Magnesium hydroxide,"Anti-caking agent, acidity regulator","Cheese, canned vegetables"
242
+ E529,Calcium oxide (quicklime),"Acidity regulator, raising agent",Sugar production Baked products
243
+ E530,Magnesium oxide,"Anti-caking agent, acidity regulator","Manufacture of powdered goods (eg, milk powder) Also used for relief of heartburn / reflux"
244
+ E535,Sodium ferrocyanide,Anti-caking agent,Added to table salt
245
+ E536,Potassium ferrocyanide,Anti-caking agent,In table salts
246
+ E538,Calcium ferrocyanide,Anti-caking agent,In table salts
247
+ E541,Sodium aluminium phosphate,Synthetically prepared raising agent,Self-raising flour
248
+ E551,Silicon dioxide (Silica),Derived from sand Used as an anti-caking agent,Potato snacks
249
+ E552,Calcium silicate,"Salt of silicon dioxide with similar functions Also used as a glazing agent, acid regulator, releasing agent, and coating agent","Found in chewing gum, meat pies, salt, and confectionery"
250
+ E553a,(i) Magnesium silicate (ii) Magnesium trisilicate,Salt of silicon dioxide with similar functions,
251
+ E553b,Talc,"Anti-caking agent, bulking agent, glazing agent",
252
+ E554,Sodium aluminium silicate,Anti-caking agent,"Used in salt and sugar products, egg mixes, flours, dried milk substitutes"
253
+ E555,Potassium aluminium silicate,Anti-caking agent,
254
+ E570,Fatty acids; stearic acid,"Anti-caking agent, flavouring agent","Baked products, chewing gum, confectionary, artificial sweeteners"
255
+ E574,Gluconic acid,Acidity regulator,
256
+ E575,Glucono delta-lactone (GDL); gluconolactone,"Acidity regulator, preservative, raising agent","Tofu making Baked, meat, and cheese products"
257
+ E576,Sodium gluconate,"Stabiliser, thickener, sequestrant Sodium salt of gluconic acid",
258
+ E577,Potassium gluconate,"Sequestrant, stabiliser, anti-caking, thickening agent Potassium salt of gluconic acid",
259
+ E578,Calcium gluconate,"Anti-caking agent, thickener, stabiliser, acidity regulator Calcium salt of gluconic acid","Health products eg, bodybuilding formulas, sports drinks Cereal Beverages Dietary supplements (calcium source)"
260
+ E579,Ferrous gluconate,"Colouring agent, nutritional supplement",Processing black olives Iron source (food fortification)
261
+ E585,Ferrous lactate,"Acidity regulator, flavouring, colour retention agent, nutritional supplement",Iron source (food fortification)
262
+ E620,L-Glutamic acid,Naturally occurring amino acid obtained from protein but generally manufactured by bacterial fermentation of carbohydrates Used as a flavour enhancer and salt substitute,Used as a nutrient to increase protein values
263
+ E621,Monosodium glutamate (MSG),Present naturally in seaweed but generally prepared chemically from sugar beet Flavour enhancer of protein rich foods,"Meat, Chinese foods, packet convenience meals and snacks (eg, soup), dried products, crisps, and potato snacks"
264
+ E622,Monopotassium glutamate,Similar to monosodium glutamate,Similar to E621
265
+ E623,Calcium glutamate,Similar to monosodium glutamate,Similar to E621
266
+ E624,Monoammonium glutamate,Ammonium salt of glutamic acid,
267
+ E625,Magnesium diglutamate,,
268
+ E626,Guanylic acid,More expensive additive,"May be found in snacks, packet soups, and instant noodles"
269
+ E627,Disodium guanylate,Occurs naturally in sardines and yeast extract but generally manufactured synthetically Used as a flavour enhancer,"Often added to crisps and other potato snacks, gravy granules and pre-cooked dried rice"
270
+ E628,Dipotassium guanylate,Flavour enhancer Potassium salt of guanylic acid,
271
+ E629,Calcium guanylate,Flavour enhancer Calcium salt of guanylic acid,
272
+ E630,Inosinic acid,Flavour enhancer,
273
+ E631,Disodium inosinate,Made from sardines and meat extract,Similar to E627
274
+ E632,Dipotassium inosinate,Flavour enhancer,
275
+ E633,Calcium inosinate,Flavour enhancer,
276
+ E634,Calcium 5'-ribonucleotides,Flavour enhancer,Mainly used in low sodium (low salt) products
277
+ E635,Sodium-5-ribonucleotide,Mixture of E627 and E631,"Added to crisps, potato snacks, and packet soups"
278
+ E640,Glycine and its sodium salt,Glycine is an amino acid Used as flavour enhancer and sweetener,Bread enhancer Also used in food supplements and protein drinks
279
+ E641,L-leucine,Flavouring agent Amino acid,
280
+ E650,Zinc acetate,Flavour enhancer,
281
+ E900,Dimethylpolysiloxane,Anti-foaming agent,Fats and oils
282
+ E901,"Beeswax, white and yellow",Glazing agent,
283
+ E902,Candelilla wax,"Glazing agent, occlusive",Chewing gums Surface finishing agent
284
+ E903,Carnauba wax,Glazing agent,"Confectionary, fruit, nuts, chocolate, chewing gum, baked goods, and coffee beans"
285
+ E904,Shellac,Glazing agent,"Fruit, candy coating"
286
+ E905,Microcrystalline wax,Glazing agent,"Fruit, candy, cheese, chewing gum"
287
+ E907,Hydrogenated poly-1-decene,,
288
+ E914,Oxidised polyethylene wax,Glazing / coating agent,Fruit
289
+ E920,L-cysteine,Amino acid,Bread enhancer
290
+ E927b,Carbamide,,
291
+ E938,Argon,Packaging gas,
292
+ E939,Helium,Packaging gas,
293
+ E941,Nitrogen,Packaging gas,
294
+ E942,Nitrous oxide,Aerosol spray propellant,
295
+ E943a,Butane,Aerosol spray propellant,
296
+ E943b,Iso-butane,Aerosol spray propellant,
297
+ E944,Propane,Aerosol spray propellant,
298
+ E948,Oxygen,Packaging gas,
299
+ E949,Hydrogen,Packaging gas,
300
+ E999,Quillaia extract,"Stabiliser, surfactant",Humectant in baked goods Soft drink foaming agent
301
+ E1200,Polydextrose,Naturally occurring sugar in grapes and corn,"Confectionery, cakes, biscuits, puddings, desserts, soft drinks, and convenience foods"
302
+ E1201,Polyvinylpyrrolidone (PVP),"Stabiliser, emulsifier, thickener",Food additive and used in wine production
303
+ E1202,Polyvinylpolypyrrolidone (PVPP),,"Clarifying agent for beer, wine, and vinegar"
304
+ E1203,Polyvinyl alcohol,"Thickener, glazing agent","Powdered desserts, confectionary, food supplements"
305
+ E1204,Pullulan,Thickener Natural polysaccharide,Edible decorating film in bakery products and confectionary Thickener in sauces and dressings
306
+ E1205,Basic methacrylate copolymer,Glazing/coating agent,
307
+ E1206,Neutral methacrylate copolymer,Glazing agent,
308
+ E1207,Anionic methacrylate copolymer,Glazing/coating agent,
309
+ E1208,Polyvinylpyrrolidone-vinyl acetate copolymer,,
310
+ E1209,Polyvinyl alcohol-polyethylene glycol-graft copolymer; PVA-PEG graft copolymer,"Glazing agent, stabiliser",
311
+ E1400-1414,Starches,"Generally of maize, corn, potato, wheat, or tapioca in origin Used to modify texture and stability","Sauces, chutneys, confectionery, desserts, meat, fish, dairy, and baked products"
312
+ E1404,Oxidised starch,,
313
+ E1410,Monostarch phosphate,"Anti-caking agent, thickener, stabiliser, emulsifier, glazing agent",
314
+ E1412,Distarch phosphate,Modified starch,"Fruit gels and cream fillings, baked goods"
315
+ E1413,Phosphated distarch phosphate,Stabiliser while freezing / thawing,"Soups, sauces, frozen pies etc."
316
+ E1414,Acetylated distarch phosphate,"Stabiliser, emulsifier",Oily foods
317
+ E1420,Acetylated starch,Modified starch,
318
+ E1422,Acetylated distarch adipate,Thickening agent,Sauces
319
+ E1440,Hydroxyl propyl starch,Modified starch,
320
+ E1442,Hydroxy propyl distarch phosphate,Modified starch,
321
+ E1450,Starch sodium octenyl succinate,Emulsifier Modified starch,
322
+ E1451,Acetylated oxidised starch,,
323
+ E1452,Starch aluminium Octenyl succinate,"Anti-caking, thickening, emulsifying, and glazing roles",
324
+ E1505,Triethyl citrate,"Stabiliser, antioxidant, glazing agent Ester of citric acid",Stabilises
325
+ E1517,Glyceryl diacetate; diacetin,Solvent for other additives,
326
+ E1518,Glyceryl triacetate; triacetin,"Humectant, flavouring agent",
327
+ E1520,"Propan-1,2-diol; propylene glycol","Synthetic carrier for extracts, flavours, and spices Functions as a stabiliser and humectant",Miscellaneous foods
328
+ E1521,Polyethylene glycol (PEG),"Colouring agent, emulsifier, flavouring, humectant",
329
+ ,Arrowroot,Natural plant starch used as a thickening agent,In glazes and jellies
330
+ ,Caffeine,Naturally occurring flavouring agent,Used in energy drinks Labelling rules apply
331
+ ,Calciferol,[Vitamin D ](/topics/vitamin-d) Generally extracted from yeast,Used to fortify margarine
332
+ ,Calcium bromate,Maturing agent and flour improver,Used in bread Banned in the EU
333
+ ,Casein,"Naturally present milk protein used as an emulsifier, texturiser, and a dietary supplement",Miscellaneous foods
334
+ ,Chlorine,Synthetically prepared bleaching agent,"White flour, white bread, cakes, and puddings"
335
+ ,Chlorine dioxide,"- Synthetically prepared additive, similar to chlorine Also used as a water purifier and oxidising agent",Similar to chlorine
336
+ ,Corn syrup,- Glucose obtained from corn or maize starch Used as a sweetener,Miscellaneous foods
337
+ ,Extenders,"Frequently a soya bean product, used to make meat go further",Meat products
338
+ ,Fructose,"- Naturally occuring sugar, present in fruit and honey Acts as a sweetener",Miscellaneous foods
339
+ ,Gelatine,- Protein extract from animal bones and tissue Used as a stabiliser and gelling agent,"Jellies, glazes, certain dessert products"
340
+ ,Hydrolysed vegetable protein (HVP),- Produced chemically from raw protein Flavour enhancer,"Soups, gravy, and meat products"
341
+ ,Invert sugar,- Syrup of 50% glucose and 50% fructose Humectant and sweetener,Confectionary and sweet products
342
+ ,[Iodine](/topics/iodine),Found in seafood,Added to salt
343
+ ,Lactose,- Sugar present naturally in milk Used as a humectant and sweetener,Infant formula
344
+ ,Niacin / nicotinic acid,- Naturally occurring B group vitamin Added to fortify food,Breakfast cereals
345
+ ,Potassium bromate,"- Oxidising agent, improver, and bleaching agent Manufactured synthetically",Added to flour No longer approved in EU
346
+ ,Sodium chloride / salt,- Naturally occurring mineral Acts as preservative and flavour enhancer,Miscellaneous foods
347
+ ,Sucrose,- From cane or beet sugar Preservative and sweetener,"Available as molasses, granulated caster, icing, and demerara sugar"
348
+ ,Thiamine,- Naturally occurring Vitamin B1 - Generally manufactured synthetically Added to fortify food,Breakfast cereals
349
+ ,Vanillin,Naturally occurring flavouring Generally manufactured synthetically,Baked products
logger_manager.py ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import logging
2
+ from logging.handlers import RotatingFileHandler
3
+
4
+ # Configure logging
5
+ logger = logging.getLogger("food_analyzer")
6
+ logger.setLevel(logging.DEBUG)
7
+
8
+ # Create a file handler that logs debug and higher level messages
9
+ file_handler = RotatingFileHandler("food_analyzer.log", maxBytes=5*1024*1024, backupCount=3)
10
+ file_handler.setLevel(logging.DEBUG)
11
+
12
+ # Create a console handler that logs error and higher level messages
13
+ console_handler = logging.StreamHandler()
14
+ console_handler.setLevel(logging.ERROR)
15
+
16
+ # Create a formatter and set it for both handlers
17
+ formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
18
+ file_handler.setFormatter(formatter)
19
+ console_handler.setFormatter(formatter)
20
+
21
+ # Add the handlers to the logger
22
+ logger.addHandler(file_handler)
23
+ logger.addHandler(console_handler)
24
+
25
+ def log_debug(message: str):
26
+ logger.debug(message)
27
+ log_info(f"Debug: {message}")
28
+ log_error(f"Debug: {message}")
29
+
30
+ def log_info(message: str):
31
+ logger.info(message)
32
+
33
+ def log_warning(message: str):
34
+ logger.warning(message)
35
+ log_info(f"Warning: {message}")
36
+ log_error(f"Warning: {message}")
37
+
38
+ def log_error(message: str):
39
+ logger.error(message)
40
+
41
+ def log_critical(message: str):
42
+ logger.critical(message)
43
+ log_info(f"Critical: {message}")
44
+ log_error(f"Critical: {message}")
main.py CHANGED
@@ -2,18 +2,14 @@ from fastapi import FastAPI
2
  from routers.auth import router as auth_router
3
  from routers.analysis import router as analysis_router
4
  from routers.history import router as history_router
5
- from database import get_db, engine
6
- from models.base import Base
7
 
8
  app = FastAPI()
9
- db = get_db()
10
 
11
- @app.on_event("startup")
12
- async def create_tables():
13
- Base.metadata.create_all(bind=engine)
14
-
15
- app.include_router(auth_router, prefix="/api")
16
- app.include_router(analysis_router, prefix="/api")
17
- app.include_router(history_router, prefix="/api")
18
 
19
  # To run the FastAPI app, use the command: uvicorn main:app --reload
 
 
 
 
2
  from routers.auth import router as auth_router
3
  from routers.analysis import router as analysis_router
4
  from routers.history import router as history_router
 
 
5
 
6
  app = FastAPI()
 
7
 
8
+ app.include_router(analysis_router, prefix="/api/analyze")
9
+ app.include_router(auth_router, prefix="/api/auth")
10
+ app.include_router(history_router, prefix="/api/history")
 
 
 
 
11
 
12
  # To run the FastAPI app, use the command: uvicorn main:app --reload
13
+ if __name__ == "__main__":
14
+ import uvicorn
15
+ uvicorn.run(app, host="0.0.0.0", port=8000)
requirements.txt CHANGED
@@ -1,13 +1,8 @@
1
- fastapi
2
- uvicorn
3
- pydantic
4
- requests
5
  pytesseract
6
  opencv-python
7
  sqlalchemy
8
  alembic
9
  redis
10
- transformers
11
  passlib
12
  python-jose
13
  python-multipart
@@ -15,4 +10,133 @@ cachetools
15
  pytest
16
  pytest-cov
17
  httpx
18
- bcrypt
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  pytesseract
2
  opencv-python
3
  sqlalchemy
4
  alembic
5
  redis
 
6
  passlib
7
  python-jose
8
  python-multipart
 
10
  pytest
11
  pytest-cov
12
  httpx
13
+ bcrypt
14
+ python-dotenv
15
+ aiohappyeyeballs==2.6.1
16
+ aiohttp==3.11.16
17
+ aiosignal==1.3.2
18
+ alembic==1.15.2
19
+ annotated-types==0.7.0
20
+ anyio==4.9.0
21
+ attrs==25.3.0
22
+ Automat==24.8.1
23
+ beautifulsoup4==4.13.3
24
+ cachetools==5.5.2
25
+ certifi==2025.1.31
26
+ cffi==1.17.1
27
+ charset-normalizer==3.4.1
28
+ click==8.1.8
29
+ colorama==0.4.6
30
+ constantly==23.10.4
31
+ cryptography==44.0.2
32
+ cssselect==1.3.0
33
+ dataclasses-json==0.6.7
34
+ defusedxml==0.7.1
35
+ duckduckgo_search==8.0.0
36
+ fastapi==0.115.12
37
+ filelock==3.18.0
38
+ filetype==1.2.0
39
+ frozenlist==1.5.0
40
+ google-ai-generativelanguage==0.6.15
41
+ google-api-core==2.24.2
42
+ google-api-python-client==2.166.0
43
+ google-auth==2.38.0
44
+ google-auth-httplib2==0.2.0
45
+ google-generativeai==0.8.4
46
+ googleapis-common-protos==1.69.2
47
+ greenlet==3.1.1
48
+ grpcio==1.71.0
49
+ grpcio-status==1.71.0
50
+ h11==0.14.0
51
+ httpcore==1.0.7
52
+ httplib2==0.22.0
53
+ httpx==0.28.1
54
+ httpx-sse==0.4.0
55
+ hyperlink==21.0.0
56
+ idna==3.10
57
+ incremental==24.7.2
58
+ itemadapter==0.11.0
59
+ itemloaders==1.3.2
60
+ jmespath==1.0.1
61
+ jsonpatch==1.33
62
+ jsonpointer==3.0.0
63
+ langchain==0.3.23
64
+ langchain-community==0.3.21
65
+ langchain-core==0.3.51
66
+ langchain-google-genai==2.0.10
67
+ langchain-text-splitters==0.3.8
68
+ langgraph==0.3.27
69
+ langgraph-checkpoint==2.0.24
70
+ langgraph-prebuilt==0.1.8
71
+ langgraph-sdk==0.1.61
72
+ langsmith==0.3.27
73
+ logging==0.4.9.6
74
+ lxml==5.3.2
75
+ Mako==1.3.10
76
+ MarkupSafe==3.0.2
77
+ marshmallow==3.26.1
78
+ multidict==6.2.0
79
+ mypy-extensions==1.0.0
80
+ numpy==2.2.4
81
+ orjson==3.10.16
82
+ ormsgpack==1.9.1
83
+ outcome==1.3.0.post0
84
+ packaging==24.2
85
+ pandas==2.2.3
86
+ parsel==1.10.0
87
+ primp==0.14.0
88
+ propcache==0.3.1
89
+ Protego==0.4.0
90
+ proto-plus==1.26.1
91
+ protobuf==5.29.4
92
+ psycopg2-binary==2.9.10
93
+ pyasn1==0.6.1
94
+ pyasn1_modules==0.4.2
95
+ pycparser==2.22
96
+ pydantic==2.11.3
97
+ pydantic-settings==2.8.1
98
+ pydantic_core==2.33.1
99
+ PyDispatcher==2.0.7
100
+ pyOpenSSL==25.0.0
101
+ pyparsing==3.2.3
102
+ PySocks==1.7.1
103
+ python-dateutil==2.9.0.post0
104
+ python-dotenv==1.1.0
105
+ pytz==2025.2
106
+ PyYAML==6.0.2
107
+ queuelib==1.8.0
108
+ requests==2.32.3
109
+ requests-file==2.1.0
110
+ requests-toolbelt==1.0.0
111
+ rsa==4.9
112
+ Scrapy==2.12.0
113
+ selenium==4.31.0
114
+ service-identity==24.2.0
115
+ setuptools==78.1.0
116
+ six==1.17.0
117
+ sniffio==1.3.1
118
+ sortedcontainers==2.4.0
119
+ soupsieve==2.6
120
+ SQLAlchemy==2.0.40
121
+ starlette==0.46.1
122
+ tenacity==9.1.2
123
+ tldextract==5.2.0
124
+ tqdm==4.67.1
125
+ trio==0.29.0
126
+ trio-websocket==0.12.2
127
+ Twisted==24.11.0
128
+ typing-inspect==0.9.0
129
+ typing-inspection==0.4.0
130
+ typing_extensions==4.13.1
131
+ tzdata==2025.2
132
+ uritemplate==4.1.1
133
+ urllib3==2.3.0
134
+ uvicorn==0.34.0
135
+ w3lib==2.3.1
136
+ websocket-client==1.8.0
137
+ wikipedia==1.4.0
138
+ wsproto==1.2.0
139
+ xxhash==3.5.0
140
+ yarl==1.19.0
141
+ zope.interface==7.2
142
+ zstandard==0.23.0