Skip to content

Proposed data structures

Sen edited this page Jul 19, 2017 · 3 revisions

Rationale

A standardised set of formats is required for the key data structures within this API. It is used for:

  • Proper communicating among several agents.
  • Rules for data entry.
  • Reflect the requirements imposed upon recipe design and ingredient analysis.

Recipe

From EDAMAM

{
    title : str,  
    author: list, as multiple authors is possible,  
    ingredients: list, sub_structure as such,  
        [  
            {name : str,  
             amt : float or int,  
             source : {db : str, eg. "usda_sr28",  
                       id : str,},
            ...
        ]
    prep : [list of steps in strings],
    yield : int, number of servings,
    ttime : float, total time required,
    img : str, path to img of meal,
    cuisinetype : str, 
    mealtype : str,
    dishtype : str
}

Food/Ingredient

From USDA Database

{
    name : { 
             sci : str,
             common : list,
             long : str,
             zh : str
           },
    portions : [
                 {
                   g : float,
                   amt : float,
                   unit : str,
                 },
                 ...
               ],
    nutrients : {abbr : 
                 {
                   name : str,
                   value : float,
                   abbr : str,
                   unit : str,
                   meta : {
                          }
                 },
                     ...
                }
    group : str
}

Clone this wiki locally