๐Ÿ‹ 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
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

Pyparsing 1.7k Dec 27, 2022
๐Ÿšฉ A simple and clean python banner generator - Banners

๐Ÿšฉ A simple and clean python banner generator - Banners

Kumar Vicku 12 Oct 09, 2022
Open-source linguistic ethnography tool for framing public opinion in mediatized groups.

Open-source linguistic ethnography tool for framing public opinion in mediatized groups. Table of Contents Installing Quickstart Links Installing Pyth

Qualichat 7 Jun 02, 2022
This project is a small tool for processing url-containing texts delivered by HUAWEI Share on Windows.

hwshare_helper This project is a small tool for handling url-containing texts delivered by HUAWEI Share on Windows. config Before use, please install

1 Jan 19, 2022
A username generator made from French Canadian most common names.

This script is used to generate a username list using the most common first and last names in Quebec in different formats. It can generate some passwords using specific patterns such as Tremblay2020.

5 Nov 26, 2022
Convert ebooks with few clicks on Telegram!

E-Book Converter Bot A bot that converts e-books to various formats, powered by calibre! It currently supports 34 input formats and 19 output formats.

Youssif Shaaban Alsager 45 Jan 05, 2023
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

Dmitry Voronin 471 Dec 20, 2022
Translate .sbv subtitle files

deepl4subtitle Deeplใ‚’ไฝฟใฃใฆๅญ—ๅน•ใƒ•ใ‚กใ‚คใƒซ(.sbv)ใ‚’็ฟป่จณใ—ใพใ™ใ€‚ใ‚ฟใ‚คใƒ ใ‚นใ‚ฟใƒณใƒ—ใ‚‚ๅซใ‚ใฆๅ‡บๅŠ›ใ—ใพใ™ใŒใ€็ฟป่จณๆ™‚ใฏใ‚ฟใ‚คใƒ ใ‚นใ‚ฟใƒณใƒ—ใฏๆ–‡ใฎไธ€้ƒจใจใฏๅˆ‡ใ‚Š้›ขใ•ใ‚Œใ‚‹ใฎใงใ€.sbvใƒ•ใ‚กใ‚คใƒซใ‚’ใใฎใพใพ็ฟป่จณๆฉŸใซ็ชใฃ่พผใ‚€ใ‚ˆใ‚Šใ‚‚้ซ˜็ฒพๅบฆใช็ฟป่จณใŒใงใใ‚‹ใฏใšใงใ™ใ€‚ ใคใ‹ใ„ใ‹ใŸ ๅ…ฅๅŠ›ใ™ใ‚‹.sbvใƒ•ใ‚กใ‚คใƒซใฎๅ‰ๅ‡ฆ็†

Yasunori Toshimitsu 1 Oct 20, 2021
This is REST-API for Indonesian Text Summarization using Non-Negative Matrix Factorization for the algorithm to summarize documents and FastAPI for the framework.

Indonesian Text Summarization Using FastAPI This is REST-API for Indonesian Text Summarization using Non-Negative Matrix Factorization for the algorit

Viqi Nurhaqiqi 2 Nov 03, 2022
Build a translation program similar to Google Translate with Python programming language and QT library

google-translate Build a translation program similar to Google Translate with Python programming language and QT library Different parts of the progra

Amir Hussein Sharifnezhad 3 Oct 09, 2021
Convert text to morse code and play morse code sound.

Convert text(english) to morse codes and play morse sound!

Mohammad Dori 5 Jul 15, 2022
Meeting, rendezvous, confluence (Finnish kohtaaminen) mark up, down, and up again.

kohtaaminen Meeting, rendezvous, confluence (Finnish kohtaaminen) mark up, down, and up again. Given a zip file containing a tree of html and media fi

Stefan Hagen 2 Dec 14, 2022
Getting git-style versioning working on RDFlib

Getting git-style versioning working on RDFlib

Gabe Fierro 1 Feb 01, 2022
A query extract python package

A query extract python package

Fayas Noushad 4 Nov 28, 2021
Python Q&A for Network Engineers

Q & A I am often asked questions about how to solve this or that problem, and I decided to post these questions and solutions here, in case it is also

Natasha Samoylenko 30 Nov 15, 2022
๐Ÿ‹ A Python package to process food

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, on

Local Seasonal 8 Apr 04, 2022
Code Jam for creating a text-based adventure game engine and custom worlds

Text Based Adventure Jam Author: Devin McIntyre Our goal is two-fold: Create a text based adventure game engine that can parse a standard file format

HTTPChat 4 Dec 26, 2021
RSS Reader application for the Emacs Application Framework.

EAF RSS Reader RSS Reader application for the Emacs Application Framework. Load application (add-to-list 'load-path "~/.emacs.d/site-lisp/eaf-rss-read

EAF 15 Dec 07, 2022
Word-Generator - Generates meaningful words from dictionary with given no. of letters and words.

Meaningful Word Generator Generates meaningful words from dictionary with given no. of letters and words. This might be useful for generating short li

Mohammed Rabil 1 Jan 01, 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