- requests
- bs4 (BeautifulSoup)
- sqlite3
- flask
- Open
scrape.py
- Set all values in the
SHOULD
dictionary toTrue
- Run
python scrape.py
from the project root directory
- Obtain a Food Data Central API key
- Create
fdc/secrets.py
and addFDC_API = 'XXXXXX'
replace your API Key - Run
python app.py
from the project root directory - Open
localhost:5000
in a web browser - Type a food name in the search bar
- Select the item you're looking for from the resulting table
- Select the fdc item from the resulting table
- Click "Connect" if you wish to make a connection
Variable | Description |
---|---|
/fdc | USDA nutrition database requests and caching |
/page_scripts | Wikipedia scraping logic |
/templates | flask HTML and templating files |
/wikipedia | Wikipedia requests and caching |
app.py | Entry point and routing logic for the Flask app |
db.py | SQL database interactions |
models.py | Data models file |
pages.py | Organizes Wikipedia page urls to be scraped by type |
scrape.py | Entry point into the scraping flow |