Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: packaging add Denmark #10388

Merged
merged 1 commit into from
Jun 23, 2024
Merged

feat: packaging add Denmark #10388

merged 1 commit into from
Jun 23, 2024

Conversation

benbenben2
Copy link
Collaborator

What

packaging codes add Denmark

Screenshot

Screenshot_20240603_192405

Related issue(s) and discussion

Part of #338

More details based on previous work (#8921, #8958, #10264, #10318, #10351):

  • lib/ProductOpener/Display.pm
    add description (name, street, city) based on columns in the file or hardcoded
  • lib/ProductOpener/PackagerCodes.pm
    add country and suffix of the code
  • scripts/update_packager_codes.pl
    add code formatting ('country' 'code' 'suffix', for example if code does not already contain 'country' or 'suffix')
    add the column name for the $code variable
  • packager-codes/
    add the csv file (mind the naming)
  • scripts/packager-codes/
    add your script (remove api keys if any)
  • update sto files
docker exec -it po_off-backend-1 bash
./scripts/update_packager_codes.pl

@benbenben2 benbenben2 self-assigned this Jun 3, 2024
@benbenben2 benbenben2 requested a review from a team as a code owner June 3, 2024 17:32
@github-actions github-actions bot added 📍🏭 Packager codes https://blog.openfoodfacts.org/en/news/discover-what-food-products-are-made-near-you-with-made-near- Display labels Jun 3, 2024
@benbenben2
Copy link
Collaborator Author

benbenben2 commented Jun 3, 2024

Get this warning...

remote: warning: See https://gh.io/lfs for more information.
remote: warning: File packager-codes/packager_codes.sto is 73.63 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.

(.sto file increased from 73.4 MB to 73.6 MB with the present PR)

Copy link

sonarcloud bot commented Jun 3, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
18.3% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

Copy link
Contributor

@stephanegigandet stephanegigandet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Copy link
Member

@teolemon teolemon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@benbenben2 benbenben2 merged commit db078e8 into main Jun 23, 2024
12 of 13 checks passed
@benbenben2 benbenben2 deleted the packaging_add_denmark branch June 23, 2024 16:10
@alexgarel
Copy link
Member

Thank you for those incredible contributions @benbenben2 !

benbenben2 added a commit that referenced this pull request Jul 16, 2024
### What
packaging codes adds Ireland

### Screenshot

![Screenshot_20240710_173536](https://github.com/openfoodfacts/openfoodfacts-server/assets/110821832/e0eb280e-5018-4daa-be72-cf0e48256762)

### Related issue(s) and discussion
Part of #338

More examples: #8921, #8958, #10264, #10318, #10351, #10388, #10485:
- lib/ProductOpener/Display.pm
add description (name, street, city) based on columns in the file or
hardcoded
- lib/ProductOpener/PackagerCodes.pm
add country and suffix of the code
- scripts/update_packager_codes.pl
add code formatting ('country' 'code' 'suffix', for example if code does
not already contain 'country' or 'suffix')
add the column name for the $code variable
- packager-codes/
add the csv file (mind the naming)
- scripts/packager-codes/
add your script
- update sto files
```
docker exec -it po_off-backend-1 bash
./scripts/update_packager_codes.pl
```

Based on the experience acquired in previous PR, I did the following
changes:
-> switch from geocode to nominatim (+ no need of API key, +/- exactly
same results)
-> reintroduced cache (introduced for Slovenija, #10124, and not used
afterward)
-> handled whole process without manual intervention (to fetch files,
_etc_.), using Excel to dataframe feature from polars and using
beautiful soup, not sure that this will be possible to do the same for
future countries but at least for that one it was successful.

Fixes: #1572
john-gom pushed a commit to 4nt0ineB/openfoodfacts-server that referenced this pull request Jul 19, 2024
### What
packaging codes adds Ireland

### Screenshot

![Screenshot_20240710_173536](https://github.com/openfoodfacts/openfoodfacts-server/assets/110821832/e0eb280e-5018-4daa-be72-cf0e48256762)

### Related issue(s) and discussion
Part of openfoodfacts#338

More examples: openfoodfacts#8921, openfoodfacts#8958, openfoodfacts#10264, openfoodfacts#10318, openfoodfacts#10351, openfoodfacts#10388, openfoodfacts#10485:
- lib/ProductOpener/Display.pm
add description (name, street, city) based on columns in the file or
hardcoded
- lib/ProductOpener/PackagerCodes.pm
add country and suffix of the code
- scripts/update_packager_codes.pl
add code formatting ('country' 'code' 'suffix', for example if code does
not already contain 'country' or 'suffix')
add the column name for the $code variable
- packager-codes/
add the csv file (mind the naming)
- scripts/packager-codes/
add your script
- update sto files
```
docker exec -it po_off-backend-1 bash
./scripts/update_packager_codes.pl
```

Based on the experience acquired in previous PR, I did the following
changes:
-> switch from geocode to nominatim (+ no need of API key, +/- exactly
same results)
-> reintroduced cache (introduced for Slovenija, openfoodfacts#10124, and not used
afterward)
-> handled whole process without manual intervention (to fetch files,
_etc_.), using Excel to dataframe feature from polars and using
beautiful soup, not sure that this will be possible to do the same for
future countries but at least for that one it was successful.

Fixes: openfoodfacts#1572
benbenben2 added a commit that referenced this pull request Jul 25, 2024
### What
packaging codes adds Luxembourg

### Screenshot
BEFORE -> AFTER

![Screenshot_20240719_172512](https://github.com/user-attachments/assets/7fc6b545-6bfb-4b29-9219-7bcb17bc4827)


### Related issue(s) and discussion
Part of #338

More examples: #8921, #8958, #10264, #10318, #10351, #10388, #10485,
#10533:
- lib/ProductOpener/Display.pm
add description (name, street, city) based on columns in the file or
hardcoded
- lib/ProductOpener/PackagerCodes.pm
add country and suffix of the code
- scripts/update_packager_codes.pl
add code formatting ('country' 'code' 'suffix', for example if code does
not already contain 'country' or 'suffix')
add the column name for the $code variable
- packager-codes/
add the csv file (mind the naming)
- scripts/packager-codes/
add your script
- update sto files
```
docker exec -it po_off-backend-1 bash
./scripts/update_packager_codes.pl
```

Fixes: #331
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🇩🇰 Denmark Display 📍🏭 Packager codes https://blog.openfoodfacts.org/en/news/discover-what-food-products-are-made-near-you-with-made-near-
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants