๐Ÿ‹ 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
Microsoft's Cascadia Code font customized to my liking.

Microsoft's Cascadia Code font customized to my liking. Also includes some simple batch patch and bake scripts to batch patch glyphs and bake font features into fonts!

Frederik List 3 Jan 29, 2022
This is an AI that is supposed to say you if your text is formal or not

This is an AI that is supposed to say you if your text is formal or not. It's written in Python 3 and has some german examples (because I'm german yk) in the text.json file. This file contains the te

1 Jan 12, 2022
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
AnnIE - Annotation Platform, tool for open information extraction annotations using text files.

AnnIE - Annotation Platform, tool for open information extraction annotations using text files.

Niklas 29 Dec 20, 2022
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
REST API for sentence tokenization and embedding using Multilingual Universal Sentence Encoder.

MUSE stands for Multilingual Universal Sentence Encoder - multilingual extension (supports 16 languages) of Universal Sentence Encoder (USE).

Dani El-Ayyass 47 Sep 05, 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
StealBit1.1 and earlier strings and config extraction scripts

StealBit1.1 and earlier scripts Use strings_decryptor.py to extract RC4 encrypted strings from a StealBit1.1 sample(s). Use config_extractor.py to ext

Soolidsnake 5 Dec 29, 2022
The project is investigating methods to extract human-marked data from document forms such as surveys and tests.

The project is investigating methods to extract human-marked data from document forms such as surveys and tests. They can read questions, multiple-choice exam papers, and grade.

Harry 5 Mar 27, 2022
This is a text summarizing tool written in Python

Summarize Written by: Ling Li Ya This is a text summarizing tool written in Python. User Guide Some things to note: The application is accessible here

Marcus Lee 2 Feb 18, 2022
Parse Any Text With Python

ParseAnyText A small package to parse strings. What is the work of it? Well It's a module to creates parser that helps to parse a text easily with les

Sayam Goswami 1 Jan 11, 2022
Um simulador de caixa registradora com database usando arquivos .txt

๐Ÿ›’ Caixa Registradora V2 โ“ - Como usar? Execute o caixa-registradora.py, nele vai ter um menu interativo, vocรช pode cadastrar diversos produtos em um

Gabriel 0 Sep 25, 2022
A neat little program to read the text from the "All Ten Fingers" program, and write them back.

ATFTyper A neat little program to read the text from the "All Ten Fingers" program, and write them back. How does it work? This program uses the Pillo

1 Nov 26, 2021
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
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
A minimal python script for generating multiple onetime use bip39 seed phrases

seed_signer_ontimes WARNING This project has mainly been used for local development, and creation should be ran on a air-gapped machine. A minimal pyt

CypherToad 4 Sep 12, 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
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
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
Username reconnaisance tool that checks the availability of a specified username on over 200 websites.

Username reconnaisance tool that checks the availability of a specified username on over 200 websites. Installation & Usage Clone from Github: $ git c

Richard Mwewa 20 Oct 30, 2022