-
Notifications
You must be signed in to change notification settings - Fork 0
/
data_uploader.py
15 lines (12 loc) · 5.44 KB
/
data_uploader.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from cluster_point import CPDatabase
from web_scraper import WebScraper
if __name__ == '__main__':
cp_db = CPDatabase()
webscraper = WebScraper()
ingredients = ["niacin", "salt", "sugar", "colors", "glucose","water","riboflavin","glycerin","fructose","gelatin","iron","niacinamide","spice","maltodextrin","molasses","semolina","cornstarch","caffeine","pectine","sucralose","carmine","palmoil","shortening","monosodium","cornsyrup","whey","corn","lactose","yellow5", "dextrose","yellow6","vitamin-B","soybean","bht","blue1","xanthangum"]
for ingredient in ingredients:
data = webscraper.get_data_in_cluster_format(ingredient)
cp_db.insert(data)
# cp_db.insert({u'Skin conditions': u'Niacinamide has been used in skin care products, including moisturizers, anti-aging products, and treatments for rosacea, a skin condition involving facial redness and pimples. The benefits of niacinamide in skin care needs to be further studied before conclusions can be made.', u'Type 2 diabetes': u'Limited research shows unclear effects of niacin on outcomes of type 2 diabetes. Human research has also shown that niacin increases blood sugar levels. People should seek medical advice before starting niacin. Further research is needed to draw conclusions.', u'Type 1 diabetes mellitus prevention (niacinamide)': u'In human research, niacinamide lacked an effect on the development of diabetes (type 1). Evidence is mixed and more study is needed in this area. ', u'Pellagra': u'Niacin (vitamin B3) and niacinamide are U.S. Food and Drug Administration (FDA)-approved for the treatment of pellagra, or niacin deficiency. Pellagra is a nutritional disease that occurs due to insufficient dietary amounts of vitamin B3 or the chemical it is made from (tryptophan). Symptoms of pellagra include skin disease, diarrhea, dementia, and depression.', u'Clogged arteries': u'Niacin decreases blood levels of cholesterol, which may reduce the risk of clogged or hardened arteries. However, niacin also can increase homocysteine levels, which may have the opposite effect. Overall, the research supports the use of niacin in combination with other drugs to reduce the risk of clogged arteries. More research is needed in this area before a firm conclusion can be drawn.', u'Age-related macular disease (eye disease)': u'Early evidence suggests that niacin may have beneficial effects in age-related macular degeneration (AMD), a disease that often leads to vision loss. More well-designed studies are needed for conclusions to be reached.', u"Alzheimer's disease (mental decline)": u"Dementia can be caused by a severe lack of niacin in the body. Early evidence suggests that taking more niacin in the diet may slow the onset of Alzheimer's disease and mental decline. Further research is needed before a conclusion can be drawn. ", u'Osteoarthritis (niacinamide)': u'Early research suggests that niacinamide may be useful in the treatment of osteoarthritis. Further research is needed before a conclusion can be made.', u'Erectile dysfunction': u'Early research suggests that niacin has a beneficial effect on erectile dysfunction. However, further well-controlled studies are needed to draw conclusions. ', u'High blood phosphorous level': u'Early evidence shows that niacinamide had reduced high phosphate levels in the blood. However, more research is needed before a firm conclusion can be made.', u'Hepatitis C': u'Early research suggests that niacin may decrease blood levels of hepatitis C, a virus that damages the liver. Notably, niacin has been also associated with liver damage. Further research is necessary for a conclusion to be made. ', u'High cholesterol': u'Niacin is a well-accepted treatment for high cholesterol. Multiple studies show that niacin (not niacinamide) has benefits on levels of high-density cholesterol (HDL or "good cholesterol"), with better results than drugs such as "statins" like atorvastatin (Lipitor\xae). There are also benefits on levels of low-density cholesterol (LDL or "bad cholesterol"), although these effects are less dramatic. Adding niacin to a second drug such as a statin may increase the effects on low-density lipoproteins. The use of niacin for the treatment of high cholesterol associated with type 2 diabetes has been controversial because of the possibility of worsening blood sugar control. People should check with a physician and pharmacist before starting niacin.', u'Heart disease': u'Niacin decreases levels of cholesterol, and other chemicals in the blood, which can reduce the risk of heart disease. However, niacin also increases homocysteine levels, which can increase this risk. Research has shown beneficial effects of niacin, especially in combination with other drugs, for preventing heart disease and fatal heart attacks. Further study is needed to draw conclusions.', u'Type 1 diabetes (slowing progression)': u'Non-human research shows that niacinamide delays the onset of insulin dependence in type 1 diabetes. However, human research assessing whether niacinamide slows progression of type 1 diabetes has yielded unclear results. Further study is needed for conclusions to be reached. ', u'Headaches': u'Early research shows that niacin may be beneficial in the treatment or prevention of headaches. More research is needed.'})
# cp_db.insert({'niacin': {'text': 'example value'}})
# cp_db.insert({'ingredient2': {'conditions': [{'condition': 'Disease','description': 'Description of desease'}, {'condition': 'Another disease','description': 'Description of desease'}]}})