Giter VIP home page Giter VIP logo

recipe-finder's Introduction

Build Status

Recipe Finder

Given a list of items in the fridge (presented as a csv list), and a collection of recipes (a collection of JSON formatted recipes), produce a recommendation for what to cook tonight.

Installation

Install all dependencies using composer:

composer install

Running

Takes two inputs, a csv file of the items in the fridge, and a json file with recipes:

php index.php <path-to-fridge.csv> <path-to-recipe.json>

fridge.csv Format

item, amount, unit, use-by

  • Item (string) = the name of the ingredient โ€“ e.g. egg) Amount (int) = the amount
  • Unit (enum) = the unit of measure, values;
    • of (for individual items; eggs, bananas etc)
    • grams
    • ml (milliliters)
    • slices
  • Use-By (date) = the use by date of the ingredient (dd/mm/yy)

e.g.

bread,10,slices,25/12/2014
cheese,10,slices,25/12/2014
butter,250,grams,25/12/2014
peanut butter,250,grams,2/12/2014
mixed salad,150,grams,26/12/2013

recipes.json format

Array of recipes with format specified as below

  • name (String)
  • ingredients
    • item (String)
    • amount (int)
    • unit (enum)

e.g.

[ {
  "name": "grilled cheese on toast",
  "ingredients": [
   { "item":"bread", "amount":"2", "unit":"slices"},
   { "item":"cheese", "amount":"2", "unit":"slices"}
  ]
} , {
  "name": "salad sandwich",
  "ingredients": [
   { "item":"bread", "amount":"2", "unit":"slices"},
   { "item":"mixed salad", "amount":"100", "unit":"grams"}
  ]
} ]

Unit Tests

cd tests
php ../vendor/phpunit/phpunit/phpunit.php -c ../phpunit.xml.dist .

recipe-finder's People

Contributors

brendan-roche avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.