Code Monkey home page Code Monkey logo

just-do-eat's Introduction

Just Do Eat !

Minimum Viable Code as a Proof of Concept

Python Proof of Concept for getting recipes from ingredients only

Usage / Example :

from justdoeat import Justdoeat
from marmiton import Marmiton

save = Justdoeat.load("data/save.p")
filtered = Justdoeat.filter(save, isVegan=True)

print("3 recettes végan aléatoires :")
for url in Justdoeat.random_recipes(filtered, 3):
    print(Marmiton.title_of_url(url))
print()

ingredients = (
    'beurre',
    'sel',
    'sucre',
    'eau',
    'tomate',
    'oignon',
    'ail',
    'poivre',
    'persil',
    'thym',
    'chair à saucisse',
    'lait',
    'muscade',
    'pomme de terre',
    'crème',
)
print("Toutes les recettes que vous pouvez faire en utilisant seulement ces"
      " ingrédients:", ', '.join(ingredients))
for url in Justdoeat.uses_only(save, ingredients):
    print(Marmiton.title_of_url(url))
print()

ingredients = (
    'chair à saucisse',
    'pomme de terre',
    'courgette',
)
print("Toutes les recettes qui utilisent chacun de ces ingrédients:",
        ', '.join(ingredients))
for url in Justdoeat.uses(save, ingredients):
    print(Marmiton.title_of_url(url))
print()

filtered = Justdoeat.filter(save, isPorkFree=True)
print("7 recettes sans porc qui ne nécessiteraient pas beaucoup d'achats"
        " supplémentaires")
for url in Justdoeat.minimum_buy(save, ingredients, 7):
    print(Marmiton.title_of_url(url))

just-do-eat's People

Contributors

claers avatar jr-k avatar laggron42 avatar poustouflan avatar remaudcorentin-dev 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.