ocp5/doc/documentation.md

1.6 KiB

Documentation

Created with

  • python 3.6.4
  • Requests
  • PyMySQL

Installation

  1. get the code : git clone git@github.com:freezed/ocp5.git
  2. create a dedicated virtualenv : python3 -m venv .venv; source .venv/bin/activate
  3. adds dependencies : cd ocp5; pip install -r requirements.txt

Collects data

  1. OpenFoodFacts data uses more than 170 fields. Here are those we keep localy :
code / _id
url
product_name
categories_tags
nutrition_grades
  1. Physical Data Model

-Physical Data Model-

  1. Edit config.py
  2. Creates local MariaDB/MySQL : python ./populate-.py

Use de CLI to get alternate product

  1. run it : python ./cli.py

  2. follow instructions :

    1. Find a substitute product

      1. Type the number corresponding to the product's category
      2. Type the number corresponding to the choosen substitute product
      3. The system shows you the product sheet :
      4. Decide if you want to save the substitute product in DB
    2. Retrieve saved substitutes