🍋 A Python package to process food

Overview

pyfood_logo


documentation pypi creative_commons_license


Pyfood is a simple Python package to process food, in different languages. Pyfood's ambition is to be the go-to library to deal with food, recipes, online menus or cookbooks.

Installation

Pyfood is intended to work with Python 3.6 or above. Installation can be done with pip:

pip install pyfood

Quickstart

At the core of Pyfood is the concept of a shelf embedded in a given region, a certain month_id and optionally a source language. You can load a shelf embedded in France in January with the following Python snippet:

from pyfood.utils import Shelf
shelf = Shelf(region='France', month_id=0)

Pyfood currently works in the following regions:

  • Canada 🇨🇦
  • EU 🇪🇺 (Europe, default)
  • France 🇫🇷
  • Germany 🇩🇪
  • Israel 🇮🇱
  • Italy 🇮🇹
  • Japan 🇯🇵
  • Portugal 🇵🇹
  • Senegal 🇸🇳
  • Spain 🇪🇸
  • United Kingdom 🇬🇧

🍐 Label baskets or recipes

Pyfood can help automatically extract and label a list of ingredients, e.g., from a basket of food, a recipe, a menu, a cookbook or a website, with attributes/categories (e.g., fruits, vegetables) and labels (e.g., vegetarian, vegan, nutrition, seasonality), in a few lines of code:

results = shelf.process_ingredients(['apple','kiwi','sugar'])
results['labels'] # vegetarian, vegan, nutrition, seasonality

🍋 Translate ingredients

Pyfood comes with a vocabulary of more than 600 ingredients and synonymes, in multiple languages, and makes it easy to work with recipes in different languages or translate ingredients from a language to another one:

results = shelf.process_ingredients(['apple','kiwi','sugar'], lang_dest='FR')
results['food_list'] # pomme, kiwi, sucre

Pyfood currently supports the following languages:

  • DE (German)
  • EN (English)
  • ES (Spanish)
  • FR (French)
  • IT (Italian)
  • PT (Portuguese)
  • UN (Universal, default)

🍓 What's in season?

Finally, Pyfood can also be used to simply query what fruits or vegetables are in season:

fruits_in_season = shelf.get_seasonal_food(key='001')
vegetables_in_season = shelf.get_seasonal_food(key='002')

Credits

📊 CIQUAL ANSES
📷 Pexels
📷 Unsplash

Useful links

License

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License by Local Seasonal

You might also like...
Python flexible slugify function

awesome-slugify Python flexible slugify function PyPi: https://pypi.python.org/pypi/awesome-slugify Github: https://github.com/dimka665/awesome-slugif

Python Lex-Yacc

PLY (Python Lex-Yacc) Copyright (C) 2001-2020 David M. Beazley (Dabeaz LLC) All rights reserved. Redistribution and use in source and binary forms, wi

Python library for creating PEG parsers

PyParsing -- A Python Parsing Module Introduction The pyparsing module is an alternative approach to creating and executing simple grammars, vs. the t

A simple Python module for parsing human names into their individual components

Name Parser A simple Python (3.2+ & 2.6+) module for parsing human names into their individual components. hn.title hn.first hn.middle hn.last hn.suff

Python port of Google's libphonenumber

phonenumbers Python Library This is a Python port of Google's libphonenumber library It supports Python 2.5-2.7 and Python 3.x (in the same codebase,

A Python library that provides an easy way to identify devices like mobile phones, tablets and their capabilities by parsing (browser) user agent strings.

Python User Agents user_agents is a Python library that provides an easy way to identify/detect devices like mobile phones, tablets and their capabili

A non-validating SQL parser module for Python

python-sqlparse - Parse SQL statements sqlparse is a non-validating SQL parser for Python. It provides support for parsing, splitting and formatting S

An anthology of a variety of tools for the Persian language in Python

An anthology of a variety of tools for the Persian language in Python

Widevine KEY Extractor in Python

Widevine Client 3 This was originally written by T3rry7f. This repo is slightly modified version of his repo. This only works on standard Windows! Usa

Comments
  • Missing ingredients / Seasonality

    Missing ingredients / Seasonality

    Handle exceptions for seasonality

    • [ ] Jus (e.g. d'orange, de citron, etc.)
    • [ ] Sirops (e.g., de grenadine, menthe, etc.)
    • [ ] Liqueurs (e.g., de grenadine, menthe, etc.)
    • [ ] Confitures (e.g., de fraise, abricot, etc.)
    • [ ] Glaces (e.g., vanille, chocolat, etc.)
    • [ ] Fruits secs / séchés
    • [ ] xx en Conserves

    Add/edit new ingredients

    Fix typos

    • [ ] Pate d amande
    bug 
    opened by local-seasonal 0
  • Supported regions

    Supported regions

    Regions currently supported

    • Canada
    • EU (Europe, default)
    • France
    • Germany
    • Israel
    • Italy
    • Japan
    • Portugal
    • Sénégal
    • Spain
    • United Kingdom

    TODO

    • [ ] Simplify / streamline process to add or review seasonality

    Regions to add support (EU)

    • [ ] Netherlands
    • [ ] Belgium
    • [ ] Greece
    • [ ] Austria
    • [ ] Finland
    • [ ] Denmark
    • [ ] Croatia
    • [ ] Lituania
    • [ ] Luxembourg
    • [ ] Poland
    • [ ] Czechia
    • [ ] Ireland
    • [ ] Slovenia
    • [ ] Malta
    • [ ] Romania
    • [ ] Sweden
    • [ ] Hungary
    • [ ] Bulgaria
    • [ ] Slovakia
    • [ ] Latvia
    • [ ] Estonia
    • [ ] Cyprus
    enhancement 
    opened by local-seasonal 1
  • Data Storage & Access

    Data Storage & Access

    Issue

    Nutrition, seasonality data and more are stored under assets/ in text, json, pickle... files which isn't very friendly for non developers

    Proposed solution

    • Save data in a user-friendly format
    • Make data accessible / editable by non developers (e.g., printable seasonal calendars)
    help wanted 
    opened by local-seasonal 0
  • Supported languages

    Supported languages

    Languages currently supported

    • French 🇫🇷
    • Italian 🇮🇹
    • English 🇬🇧
    • Spanish 🇪🇸
    • German 🇩🇪
    • Portuguese 🇵🇹

    Languages to add support

    • [ ] Replace Chinese (traditional) by Chinese (simplified)
    • [ ] Add Greek (i18 l10n)
    • [ ] Add Dutch (i18 l10n)
    • [ ] Add Polish (i18 l10n)
    • [ ] Add Russian (i18 l10n)
    • [ ] Add Japanese (i18 l10n)
    • [ ] Add Portuguese Brazil (i18 l10n)
    • [ ] Add Korean (i18 l10n)
    • [ ] Add Arab (i18 l10n)
    enhancement 
    opened by local-seasonal 0
Releases(v0.0.5)
Owner
Local Seasonal
Local Seasonal is a French non profit. Our mission is to reconnect people with food and with each other by celebrating biodiversity along the seasons
Local Seasonal
CowExcept - Spice up those exceptions with cowexcept!

CowExcept - Spice up those exceptions with cowexcept!

James Ansley 41 Jun 30, 2022
从flomo导出的笔记中生成词云

flomo-word-cloud 从flomo导出的笔记中生成词云 如何使用? 将本项目克隆到你的电脑上,使用如下的命令,安装所需python库 pip install -r requirements.txt 在项目里新建一个file文件夹,把所有从flomo导出的html文件放入其中 运行main

Hannnk 9 Dec 30, 2022
A Python app which can convert normal text to Handwritten text.

Text to HandWritten Text ✍️ Converter Watch Tutorial for this project Usage:- Clone my repository. Open CMD in working directory. Run following comman

Kushal Bhavsar 5 Dec 11, 2022
Python character encoding detector

Chardet: The Universal Character Encoding Detector Detects ASCII, UTF-8, UTF-16 (2 variants), UTF-32 (4 variants) Big5, GB2312, EUC-TW, HZ-GB-2312, IS

Character Encoding Detector 1.8k Jan 08, 2023
py-trans is a Free Python library for translate text into different languages.

Free Python library to translate text into different languages.

I'm Not A Bot #Left_TG 13 Aug 27, 2022
strbind - lapidary text converter for translate an text file to the C-style string

strbind strbind - lapidary text converter for translate an text file to the C-style string. My motivation is fast adding large text chunks to the C co

Mihail Zaytsev 1 Oct 22, 2021
A slugifier that works in unicode

Unicode Slugify Unicode Slugify is a slugifier that generates unicode slugs. It was originally used in the Firefox Add-ons web site to generate slugs

Mozilla 315 Nov 21, 2022
text-to-speach bot - You really do NOT have time for read a newsletter? Now you can listen to it

NewsletterReader You really do NOT have time for read a newsletter? Now you can listen to it The Newsletter of Filipe Deschamps is a great place to re

ItanuRomero 8 Sep 18, 2021
Convert English text to IPA using the toPhonetic

Installation: Windows python -m pip install text2ipa macOS sudo pip3 install text2ipa Linux pip install text2ipa Features Convert English text to I

Joseph Quang 3 Jun 14, 2022
Extract price amount and currency symbol from a raw text string

price-parser is a small library for extracting price and currency from raw text strings.

Scrapinghub 252 Dec 31, 2022
Simple python program to auto credit your code, text, book, whatever!

Credit Simple python program to auto credit your code, text, book, whatever! Setup First change credit_text to whatever text you would like to credit

Hashm 1 Jan 29, 2022
A generator library for concise, unambiguous and URL-safe UUIDs.

Description shortuuid is a simple python library that generates concise, unambiguous, URL-safe UUIDs. Often, one needs to use non-sequential IDs in pl

Stavros Korokithakis 1.8k Dec 31, 2022
Python Lex-Yacc

PLY (Python Lex-Yacc) Copyright (C) 2001-2020 David M. Beazley (Dabeaz LLC) All rights reserved. Redistribution and use in source and binary forms, wi

David Beazley 2.4k Dec 31, 2022
The bot creates hashtags for user's texts in Russian and English.

telegram_bot_hashtags The bot creates hashtags for user's texts in Russian and English. It is a simple bot for creating hashtags. NOTE file config.py

Yana Davydovich 2 Feb 12, 2022
PyMultiDictionary is a Dictionary Module for Python 3+ to get meanings, translations, synonyms and antonyms of words in 20 different languages

PyMultiDictionary PyMultiDictionary is a Dictionary Module for Python 3+ to get meanings, translations, synonyms and antonyms of words in 20 different

Pablo Pizarro R. 19 Dec 26, 2022
Free & simple way to encipher text

VenSipher VenSipher is a free medium through which text can be enciphered. It can convert any text into an unrecognizable secret text that can only be

3 Jan 28, 2022
A collection of pre-commit hooks for handling text files.

texthooks A collection of pre-commit hooks for handling text files. In particular, hooks for handling unicode characters which may be undesirable in a

Stephen Rosen 5 Oct 28, 2022
A python tool to convert Bangla Bijoy text to Unicode text.

Unicode Converter A python tool to convert Bangla Bijoy text to Unicode text. Installation Unicode Converter can be installed via PyPi. Make sure pip

Shahad Mahmud 10 Sep 29, 2022
This script has been created in order to find what are the most common demanded technologies in Data Engineering field.

This is a Python script that given a whole corpus of job descriptions and a file with keywords it extracts the number of number of ocurrences of these keywords and write it to a file. This script it

Antonio Bri Pérez 0 Jul 17, 2022
An extension to detect if the articles content match its title.

Clickbait Detector An extension to detect if the articles content match its title. This was developed in a period of 24-hours in a hackathon called 'H

Arvind Krishna 5 Jul 26, 2022