Giter Club home page Giter Club logo

openfoodfacts-dart's Introduction

Pub Version Run sdk tests likes popularity pub points

Open Food Facts - Dart

Dart package for the Open Food Facts API. Easily access to more than 1.9 million products from all around the world. Open Food Facts is powered by contributors from around the world and is constantly growing thanks to them.

How to use ?

You can find the full documentation here: Documentation. You can find automated code documentation here: Documentation.

General principles

  • You can look for information about products, including many useful computed values.
  • If you can't get the information on a specific product, you can get your user to send photos and data, that will then be processed by Open Food Facts AI and contributors to get the computed result you want to show them.
  • You can also implement the complete flow so that they get immediately the result with some effort on their side.

Main fixes to apply when dealing with 2.x.x breaking changes.

  • Now the only entry point is import 'package:openfoodfacts/openfoodfacts.dart';
    • replace all your instances of import 'package:openfoodfacts/...'; with a single import 'package:openfoodfacts/openfoodfacts.dart';
  • If you used State from product_state.dart, you have to rename it to ProductState
  • If you used Level from nutrient_levels.dart, you have to rename it to NutrientLevel
  • Removed deprecated classes:
    • Page
    • ProductListQueryConfiguration
    • ToBeCompletedConfiguration
  • Removed deprecated fields and methods in Nutriments
    • all the single nutrient value fields were removed - use getValue and setValue instead
    • instead of getUnit use nutrient.typicalUnit

Contributing

If your users do not expect a specific result immediately (eg. Inventory apps)

  • Send photos (front/nutrition/ingredients/packaging): most painless thing for your users
  • The Open Food Facts AI Robotoff will generate some derived data from the photos
  • Overtime, other apps, and the Open Food Facts community will fill the data gaps

If your users do expect a result immediately (eg Nutrition apps, Scoring apps…):

  • Send nutrition facts + category > get the Nutri-Score
  • Send ingredients > get the NOVA group (about food ultra-processing), additives, allergens, normalized ingredients, vegan, vegetarian…
  • Send category (strict minimum) + labels + origins of ingredients + packaging (photo and text) > get the Eco-Score (about environmental impact)

Open Data Licence

The database in under the OdBL. This means attributing the source and also contributing back any additions (photos, data), which this package makes easy to do. You can check the terms of use here : Terms of use.

List of current features

GENERAL

  • Multilingual (180 languages are supported)
  • Create users
  • Check if users exist

READ

  • Product: you can retrieve information about products
  • Product images (get product image by field, size and language, current fields are: Front, Ingredients, Nutrition, Packaging)
  • Additives, Allergens, Environment impact, Ingredient analysis, Nutrient levels, Nutrition facts (incl. micro-nutrients)
  • Language dependant fields (like ingredients, product name, packaging text)
  • Eco-Score, Nutri-Score, NOVA groups
  • Translated, high-level and customizable product information (Attributes)
  • Product completion status
  • Folksonomy Engine (custom properties for products)
  • Open Food Facts Events (Gamification)

PERSONALIZATION

  • Recommended Daily Intakes
  • Translated, high-level and customizable product information (Attributes)
  • Autocompleting for the user inputs, by giving suggestions for (Labels, categories, ingredients, additives, traces ...)

SEARCH

  • search products by tags
  • search products with / without additives
  • search products with keywords
  • Personalized search

WRITE

  • Save product to Open Food Facts
  • Send images
  • User comments and auth
  • Anonymous photo upload
  • Photo operations (rotate, crop, select, unselect with language awareness)

ML

  • Robotoff support
  • Extract ingredients from ingredients image: User can extract the ingredients text if it is missing
  • Get the OCR of the ingredients photo (for validation purposes)

Roadmap

READ

  • ???

WRITE

Other

Contribute

There are many ways to contribute, and Open Food Facts has a lot of projects beside this package. Most of our operations are coordinated through our Slack which you can join here : Open Food Facts Slack.

Regarding this package, we accept pull requests as well feature requests.

Testing

Execute the following command from the root of the repository to run the tests:

dart test

Applications using this SDK

Official application

Smoothie is the official developed by Open Food Facts, which will soon be released on Android and iOS. The source code is also available on GitHub.

Third party applications

Feel free to open a PR to add your application in this list.

Authors

openfoodfacts-dart's People

Contributors

monsieurtanuki avatar grumpf avatar peterwvj avatar stephanegigandet avatar m123-dev avatar github-actions[bot] avatar jasmeet0817 avatar teolemon avatar mohamedfboussaid avatar dependabot[bot] avatar primaelquemerais avatar grumpf86 avatar blazern avatar gspencergoog avatar g123k avatar indigothm avatar fredjul avatar vaiton avatar fibbers avatar akashsri3bi avatar ashaman999 avatar kant avatar adfaure avatar cantum2 avatar vik4114 avatar cli1005 avatar lsaudon avatar

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.