openfoodfacts / openfoodfacts-server

Open Food Facts database, API server and web interface - 🐪🦋 Perl, CSS and JS coders welcome 😊 For helping in Python, see Robotoff or taxonomy-editor
http://openfoodfacts.github.io/openfoodfacts-server/
GNU Affero General Public License v3.0
664 stars 392 forks source link

Add data to identify obsolete products into CSV export #8948

Open CharlesNepote opened 1 year ago

CharlesNepote commented 1 year ago

Obsolete products are exported into the CSV daily export, which is a good thing, but in the CSV export there are no data at all to identify the products which are obsoletes. This information can be interesting for many use cases:

In the JSON API, there are these values:

    "obsolete": "on",
    "obsolete_imported": "1",
    "obsolete_since_date": "2023/07/01",
    "obsolete_since_date_imported": "2023/07/01",

(Example.)

We could export in the CSV file:

  1. either only "obsolete": "on" for a minimal information
  2. either "obsolete": "on" and "obsolete_since_date": "2023/07/01" to allow monitoring obsolete products.

I would in favor of the second option.

Part of

alexgarel commented 1 year ago

Why not only obsolete_since_date only ? Empty means it's not obsolete.

CharlesNepote commented 1 year ago

Why not only obsolete_since_date only ? Empty means it's not obsolete.

There is this case where an EAN could be abandoned at a given date and reused years afters -- so we could have "obsolete": "off" and "obsolete_since_date": "2023/07/01" but it's a bit weird and even confusing...

So I think obsolete_since_date should make it, indeed.

github-actions[bot] commented 1 year ago

This issue has been open 90 days with no activity. Can you give it a little love by linking it to a parent issue, adding relevant labels and projets, creating a mockup if applicable, adding code pointers from https://github.com/openfoodfacts/openfoodfacts-server/blob/main/.github/labeler.yml, giving it a priority, editing the original issue to have a more comprehensive description… Thank you very much for your contribution to 🍊 Open Food Facts

tchen0125 commented 8 months ago

Can I work on this issue?

hangy commented 8 months ago

Note that there might be some conflicts with #9684, as both issues are about the same export script

raphodn commented 7 months ago

There is also a similar issue #8338 where the idea would be to do seperate CSV/JSONL exports for obsolete products, as they are stored in a seperate database