Giter Club home page Giter Club logo

is-vegan's Introduction

Build Status npm version codecov

is-vegan

Is-Vegan helps you to find out which food ingredients are vegan / non-vegan. It can answer that on 1 ingredient or on a list of ingredients. It uses a 850+ entries list of non-vegan ingredients.

Wanna buy me a Coffee?

How to use?

Free API Service?

Why?

We are aware that 'veganism' and the definition of it can be a hot topic. We created the non-vegan list keeping in mind that veganism in dietary terms, it denotes the practice of dispensing with all products derived wholly or partly from animals.

Our first step is the approach to help people understand, which products, and where applicable its ingredients, do not involve, or have involved, the use of any animal product, by-product or derivative. It is not driven about any vegan lifestyle choice or stereotype. We welcome and appreciate any help and concerence regarding the nonvegan/canbevegan list.

Currently we are unfortunatly not adressing any other forms of exploitation of, and cruelty to, animals for clothing, cosmetics or any other purpose.

Thank you all for your comments, we appreciate the discussion, as we grow and learn from your input.

All comments on Hacker News

Sources

We want to make sure that you understand how is-vegan is implemented. We analyzed as many good information websites for vegan / non-vegan ingredients as we found to get a very accurate list of ingredients. However, feel free to send a pull request with an updated version of the list.

Websites we parsed:

and we added also a few ourselves...

Usage

Add

yarn add is-vegan

or

npm install is-vegan --save

example

const isVegan = require('is-vegan');

// or

import * as isVegan from 'is-vegan';

// example for single ingredient
isVegan.isVeganIngredient('soy'); // true
isVegan.isVeganIngredient('milk'); // false

// example for list of ingredients
isVegan.isVeganIngredientList(['aspic', 'albumin']); // false
isVegan.isVeganIngredientList(['soy', 'cacao butter']); // true

// example for list of ingredients
isVegan.containsNonVeganIngredients(['aspic', 'albumin', 'soy']); // ['aspic', 'albumin']
isVegan.containsNonVeganIngredients(['soy', 'cacao butter']); // []

// example for list of ingredients wich contain flagged and non-vegan ingredients
isVegan.checkIngredients(['soy', 'cacao butter', 'pork', 'beef', 'glycine']);
// returns
// {
//   nonvegan: ['pork', 'beef'],
//   flagged: ['glycine']
// }

// example for list of ingredients in Italian language
isVegan.setIngredientsLanguage('it'); // 'it' is the two-letter ISO 639-1 code for the Italian language
isVegan.checkIngredients([
  'manzo',
  'maiale',
  'glicina',
  'biotina',
  'soia',
  'aglio',
]);
// returns
// {
//   nonvegan: ['manzo', 'maiale'],
//   flagged: ['glicina', 'biotina']
// }

// or

import { checkIngredients } from 'is-vegan';

// example for list of ingredients wich contain flagged and non-vegan ingredients
checkIngredients(['soy', 'cacao butter', 'pork', 'beef', 'glycine']);

// returns
// {
//   nonvegan: ['pork', 'beef'],
//   flagged: ['glycine']
// }

real world example

Products searched on USDA Food Composition Databases

const isVegan = require('is-vegan');

// MOSER ROTH, DARK CHOCOLATE
isVegan.isVeganIngredientList([
  'COCOA LIQUOR',
  'SUGAR',
  'COCOA BUTTER',
  'ALKALIZED REDUCED FAT COCOA POWDER',
  'SOY LECITHIN EMULSIFIER',
  'GROUND VANILLA',
]); // returns true

Checkout: RunKit "is-vegan-playground" for more examples

Free API

https://is-vegan.netlify.com/

Test

yarn test

Thanks for translating the lists to italian

gianantoniopini

Alfred Workflow by Kyle Brumm (kjbrum)

alfred-is-vegan

TODO

  • extend list

Authors

  • Hamed Montazeri
  • Meike Rittmeier

is-vegan's People

Contributors

dependabot[bot] avatar gianantoniopini avatar glinkis avatar hanimay avatar hmontazeri avatar hmontazerimhp avatar mikamkr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

is-vegan's Issues

Spanish support

Hi,
Forking and adding Spanish support for the list of ingredients (nonvegan and canbevegan). I'd suggest creating a pull request from branch develop. But I have seen pull requests into master directly (e.g. #40). What is the project practice?

German Language Support

I would like to add german language support. Ive seen that the last changes were made some years ago. Is there still some need for that? Should I create the pull request on the branch "development" if you think there is a need?

Change blacklist to nonVeganList

Since blacklist is discriminatory and pejorative term, you should use a non discriminatory term. Since the usual fix (blocklist instead of blacklist) is not really applicable here, I suggest that you replace blacklist with nonVeganList.

Allow users to flag ingredients?

Reading the other issues it seems like it will be difficult to avoid false positives and false negatives. It might help to have users of is-vegan to have the option to flag any mistakes to get closer to 100% accuracy?

Non-vegan ingredients listed as vegan

Some ingredients that are or may be of animal origin are shown as vegan safe.

Bees wax (E901) is obviously an animal product but is identified as vegan:

curl -L "https://is-vegan.netlify.com/.netlify/functions/api?ingredients=e901"
{"checkedIngredient":"e901","isVeganSafe":true}

Same with lactitol (E966) and lysozyme (E1055). Several possibly non-vegan (according to The Vegetarian Society) E-numbers are also shown as vegan.

Feature Request: API

It would be awesome if this list could be made into a public API to be consumed through apps, like my Alfred workflow.

Integration with Open Food Facts

Open Food Facts collects food products from around the world, using mobile crowdsourcing.
It's open data and opensource.
We have barcode data, and product data, including multilingual ingredient lists, multilingual ingredient taxonomies.

github.com/openfoodfacts
world.openfoodfacts.org

We also have a Slack with a Vegan/Vegetarian channel (self invitation at https://slack-ssl-openfoodfacts.herokuapp.com/ )

pasteurized milk

in your example in the readme, there is "pasteurized milk" in the ingredients list, but it isn't returned as a non-vegan item

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.