openfoodfacts-server icon indicating copy to clipboard operation
openfoodfacts-server copied to clipboard

Add data to identify obsolete products into CSV export

Open CharlesNepote opened this issue 1 year ago • 6 comments

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:

  • researcher might need this data for studies (health, economy...)
  • reusers might need this data to tell their users which products are no more sold
  • reusers could exclude the products that have been tagged as obsolete since a certain amount of time
  • it can be useful to monitor the modifications of these products (data quality...)
  • it can be interesting to monitor the evolution of some brands
  • etc.

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.

  • See also: https://github.com/openfoodfacts/openfoodfacts-server/issues/8949

Part of

  • #8814
  • #6429

CharlesNepote avatar Sep 05 '23 07:09 CharlesNepote

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

alexgarel avatar Sep 05 '23 08:09 alexgarel

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.

CharlesNepote avatar Sep 05 '23 13:09 CharlesNepote

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

github-actions[bot] avatar Dec 05 '23 00:12 github-actions[bot]

Can I work on this issue?

tchen0125 avatar Mar 27 '24 17:03 tchen0125

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

hangy avatar Mar 28 '24 21:03 hangy

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

raphodn avatar May 02 '24 13:05 raphodn