Giter Club home page Giter Club logo

Comments (3)

berrnd avatar berrnd commented on May 22, 2024 4

This is now also done - I added a kind of plugin like system to lookup products by barcodes, see the reference implementation of such a plugin in data/plugins/DemoBarcodeLookupPlugin.php

In short:
Via the REST API at /api/stock/external-barcode-lookup/123456 products can be looked up by barcode via the configured plugin.

Additionally when also ?add=true is provided, on a successful lookup the product is also added to the database and in the output the new product id is included.

Direct link to the API documentation: https://demo-en.grocy.info/api#/Stock/get_stock_external_barcode_lookup__barcode_

Maybe this works for you...

:)

from grocy.

gruessung avatar gruessung commented on May 22, 2024 2

Yes, it would better to establish a modular way.
The API of opengtindb.org is not free, right. But all datasets are licensed under GNU. Some times ago i build a wrapper for this website to extract all neccesarry data out of the source code.
If you provice a plugin api for grocy, i would create a plugin for opengtindb.org.

Edit: https://github.com/gruessung/IntelliFridge/blob/master/eanApi.php

from grocy.

berrnd avatar berrnd commented on May 22, 2024

It seems that the API of opengtindb.org is not free and also only available for commercial purposes.
When doing this, it would be best to do it in an "plugin like" way, not hardcode to a specific service...

The information to get would be currently only the name and the quantity unit (would need a mapping to own quantity units).

When the major bunch of products are added to the database, from my personal experience with grocy in nearly 1 year daily use, it's not a big problem:

  • I keep generic named products only in my database (means for example I only have "Chocolate", although I buy it from different brands)
  • To a product multiple barcodes can be assigned (different brands of chocolate...)
  • Assigning unknown barcodes and creating products can be directly done in a kind of "workflow" during purchase scanning (a popup appears when you leave the product input field when something unknown was entered)

from grocy.

Related Issues (20)

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.