🍋 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
A query extract python package

A query extract python package

Fayas Noushad 4 Nov 28, 2021
Compute distance between sequences. 30+ algorithms, pure python implementation, common interface, optional external libs usage.

TextDistance TextDistance -- python library for comparing distance between two or more sequences by many algorithms. Features: 30+ algorithms Pure pyt

Life4 3k Jan 02, 2023
An experimental Fang Song style Chinese font generated with skeleton-tracing and pix2pix

An experimental Fang Song style Chinese font generated with skeleton-tracing and pix2pix, with glyphs based on cwTeXFangSong. The font is optimised fo

Lingdong Huang 98 Jan 07, 2023
LazyText is inspired b the idea of lazypredict, a library which helps build a lot of basic models without much code.

LazyText is inspired b the idea of lazypredict, a library which helps build a lot of basic models without much code. LazyText is for text what lazypredict is for numeric data.

Jay Vala 13 Nov 04, 2022
pydantic-i18n is an extension to support an i18n for the pydantic error messages.

pydantic-i18n is an extension to support an i18n for the pydantic error messages

Boardpack 48 Dec 21, 2022
Bidirectionally transformed strings

bistring The bistring library provides non-destructive versions of common string processing operations like normalization, case folding, and find/repl

Microsoft 352 Dec 19, 2022
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
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
一款高性能敏感词(非法词/脏字)检测过滤组件,附带繁体简体互换,支持全角半角互换,汉字转拼音,模糊搜索等功能。

一款高性能非法词(敏感词)检测组件,附带繁体简体互换,支持全角半角互换,获取拼音首字母,获取拼音字母,拼音模糊搜索等功能。

ToolGood 3.6k Jan 07, 2023
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
A python tool one can extract the "hash" from a WINDOWS HELLO PIN

WINHELLO2hashcat About With this tool one can extract the "hash" from a WINDOWS HELLO PIN. This hash can be cracked with Hashcat, more precisely with

33 Dec 05, 2022
Translate .sbv subtitle files

deepl4subtitle Deeplを使って字幕ファイル(.sbv)を翻訳します。タイムスタンプも含めて出力しますが、翻訳時はタイムスタンプは文の一部とは切り離されるので、.sbvファイルをそのまま翻訳機に突っ込むよりも高精度な翻訳ができるはずです。 つかいかた 入力する.sbvファイルの前処理

Yasunori Toshimitsu 1 Oct 20, 2021
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,

David Drysdale 3.1k Dec 29, 2022
Fuzzy string matching like a boss. It uses Levenshtein Distance to calculate the differences between sequences in a simple-to-use package.

Fuzzy string matching like a boss. It uses Levenshtein Distance to calculate the differences between sequences in a simple-to-use package.

SeatGeek 1.2k Jan 01, 2023
Wikipedia Extractive Text Summarizer + Keywords Identification (entropy-based)

Wikipedia Extractive Text Summarizer + Keywords Identification (entropy-based)Wikipedia Extractive Text Summarizer + Keywords Identification (entropy-based)

Kevin Lai 1 Nov 08, 2021
Word and phrase lists in CSV

Word Lists Word and phrase lists in CSV, collected from different sources. Oxford Word Lists: oxford-5k.csv - Oxford 3000 and 5000 oxford-opal.csv - O

Anton Zhiyanov 14 Oct 14, 2022
Fuzzy String Matching in Python

FuzzyWuzzy Fuzzy string matching like a boss. It uses Levenshtein Distance to calculate the differences between sequences in a simple-to-use package.

SeatGeek 8.8k Jan 08, 2023
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

Persian Tools 106 Nov 08, 2022
This repository contains scripts to control a RGB text fan attached to a Raspberry Pi.

RGB Text Fan Controller This repository contains scripts to control a RGB text fan attached to a Raspberry Pi. Setup The Raspberry Pi and RGB text fan

Luke Prior 1 Oct 01, 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