๐Ÿ‹ 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 Python package to facilitate research on building and evaluating automated scoring models.

Rater Scoring Modeling Tool Introduction Automated scoring of written and spoken test responses is a growing field in educational natural language pro

ETS 59 Oct 10, 2022
A query extract python package

A query extract python package

Fayas Noushad 4 Nov 28, 2021
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 1, 2023
Implementation of hashids (http://hashids.org) in Python. Compatible with Pythonโ€‰2 and Pythonโ€‰3

hashids for Python 2.7 & 3 A python port of the JavaScript hashids implementation. It generates YouTube-like hashes from one or many numbers. Use hash

David Aurelio 1.4k Jan 2, 2023
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 8, 2023
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 8, 2023
The Levenshtein Python C extension module contains functions for fast computation of Levenshtein distance and string similarity

Contents Maintainer wanted Introduction Installation Documentation License History Source code Authors Maintainer wanted I am looking for a new mainta

Antti Haapala 1.2k Dec 16, 2022
Paranoid text spacing in Python

pangu.py Paranoid text spacing for good readability, to automatically insert whitespace between CJK (Chinese, Japanese, Korean) and half-width charact

Vinta Chen 194 Nov 19, 2022
An implementation of figlet written in Python

All of the documentation and the majority of the work done was by Christopher Jones ([email protected]). Packaged by Peter Waller <[email protected]>,

Peter Waller 1.1k Jan 2, 2023
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 2, 2023