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
GNU Affero General Public License v3.0
611 stars 357 forks source link

Load all remaining EU packaging codes #338

Open teolemon opened 8 years ago

teolemon commented 8 years ago
### Tasks
- [x] Austria #333
- [x] Belgium #1492
- [ ] #6512
- [x] Load packager codes for Croatia
- [x] Load packager codes for Republic of Cyprus
- [x] Load packager codes for Czech Republic
- [ ] Load packager codes for Denmark
- [x] Load packager codes for Estonia
- [x] Load packager codes for Finland
- [x] Load packager codes for France
- [x] Load packager codes for Germany
- [ ] Load packager codes for Greece
- [ ] Hungary #1494
- [ ] Ireland #1572
- [x] Load packager codes for Italy
- [ ] Load packager codes for Latvia
- [x] Lithuania #1493
- [ ] Luxembourg #331
- [ ] Load packager codes for Malta
- [ ] Netherlands #335
- [x] Poland #334
- [ ] Portugal #1468
- [ ] Load packager codes for Romania
- [ ] Slovakia #1555
- [ ] https://github.com/openfoodfacts/openfoodfacts-server/issues/8958
- [x] Load packager codes for Spain
- [x] Sweden #1477
- [x] Load packager codes for UK

Part of

MaximeLaurenty commented 5 years ago

please update

teolemon commented 5 years ago

done

teolemon commented 5 years ago

Luxembourg claimed and done by @k3lyn

MaximeLaurenty commented 5 years ago

Portugal claimed & under progress

MaximeLaurenty commented 5 years ago

A small python code that I wrote to help me aggregate all csv file into one (useful when there are a lot of them ...) Feel free to use.

import csv
import os
### Lines with 3 ### might need adaptation to your need
MAIN_CSV = '/Users/Maxime/Downloads/Portugal/Portugal.csv' ### PATH of the csv where you will agregate everything
main_csv_file = open(MAIN_CSV, 'a', newline='',encoding = "UTF-8")  # 'a' to append and not overwrite ; encoding might need adaptation to handle special characters
main_csv_writer = csv.writer(main_csv_file, delimiter=';',quotechar='|') ### DELIMITER to choose wisely

folder_path = "/Users/Maxime/Downloads/Portugal/sources" ### SET to your folder with all csv
for file in os.listdir(folder_path):  #loop over all files
    if not file.startswith('.'):  #avoid any hidden file, useful on mac
        print ('handling : '+file)
        with open(folder_path+'/'+file, newline='',encoding = "ISO-8859-1") as csvfile: ###Adapt encoding to your country source encoding
            csvreader = csv.reader(csvfile, delimiter=';',quotechar='|')
            #print('csv reader is ok')
            i=0
            for row in csvreader:
                #print ('row = ', i) 
                #print (row)
                if i!=0: ### to avoid the first line with all column labels
                    main_csv_writer.writerow(row)
                i+=1
            print (str(i)+' rows have been loaded')
main_csv_file.close()
MaximeLaurenty commented 5 years ago

Portugal done. Sweden claimed and done.

Makitsu commented 5 years ago

Thanks for the code ! Slovakia claimed.

MaximeLaurenty commented 5 years ago

Ireland claimed.

k3lyan commented 5 years ago

Norway claimed. sections: 0,5, 6, 9, 10, 12, 13 done. I upload the corresponding csv.

Ban3 commented 4 years ago

Finland was done in #2620

benbenben2 commented 2 months ago

List of all packaging codes in EU

https://food.ec.europa.eu/safety/biological-safety/food-hygiene/approved-eu-food-establishments/national-websites_en