1.6 KiB
1.6 KiB
Documentation
Created with
python 3.6.4
Requests
PyMySQL
Installation
- get the code :
git clone git@github.com:freezed/ocp5.git
- create a dedicated virtualenv :
python3 -m venv .venv; source .venv/bin/activate
- adds dependencies :
cd ocp5; pip install -r requirements.txt
Collects data
- OpenFoodFacts data uses more than 170 fields. Here are those we keep localy :
code / _id
url
product_name
categories_tags
nutrition_grades
- Physical Data Model
- Edit config.py
- Creates local MariaDB/MySQL :
python ./populate-.py
Use de CLI to get alternate product
-
run it :
python ./cli.py
-
follow instructions :
-
Find a substitute product
- Type the number corresponding to the product's category
- Type the number corresponding to the choosen substitute product
- The system shows you the product sheet :
- description
- the product link to OpenFoodFacts website
- Decide if you want to save the substitute product in DB
-
Retrieve saved substitutes
-