ocp5/doc/documentation.md

2.2 KiB

Documentation

Created with

  • python 3.6.4
  • Requests
  • ~PyMySQL or openfoodfacts-python~ TODO #4

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
product_name
categories_fr
nutrition-score-fr_100g
  1. Request will only ask for tagged products with 'countries':'france'
  2. Physical Data Model

-Physical Data Model-

  1. ~Creates local MariaDB/MySQL : ./create-db.py~ TODO #2

Use de CLI to get alternate product

  1. ~run it : ./main.py~ TODO #5

  2. ~follow instructions :~ TODO #5

    1. Find an alternative product

      1. Type the number corresponding to the product's category
      2. Type the number corresponding to the choosen alternative product
      3. The system shows you the product sheet :
        • description
        • a shop where you can buy it (if available)
        • the product link to OpenFoodFacts website
      4. Decide if you want to save the alternative product in DB
    2. Retrieve saved alternatives products

      1. Type the number corresponding to the choosen alternative product
      2. The system shows you the product sheet :
        • description
        • a shop where you can buy it (if available)
        • the product link to OpenFoodFacts website