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

Load all remaining EU packaging codes #338

Open
15 of 28 tasks
teolemon opened this issue Jun 26, 2016 · 11 comments · Fixed by #8921
Open
15 of 28 tasks

Load all remaining EU packaging codes #338

teolemon opened this issue Jun 26, 2016 · 11 comments · Fixed by #8921
Labels
Epic 📍🏭 Packager codes https://blog.openfoodfacts.org/en/news/discover-what-food-products-are-made-near-you-with-made-near-

Comments

@teolemon
Copy link
Member

teolemon commented Jun 26, 2016

Tasks

  1. ⏰ Stale ✨ Feature 🇧🇬 Bulgaria 📍🏭 Packager codes
  2. 🇸🇮 Slovenia 📍🏭 Packager codes
    benbenben2

Part of

@teolemon teolemon added the 📍🏭 Packager codes https://blog.openfoodfacts.org/en/news/discover-what-food-products-are-made-near-you-with-made-near- label Dec 11, 2016
@MaximeLaurenty
Copy link
Contributor

please update

@teolemon
Copy link
Member Author

teolemon commented Nov 7, 2018

done

@teolemon
Copy link
Member Author

teolemon commented Nov 7, 2018

Luxembourg claimed and done by @k3lyn

@MaximeLaurenty
Copy link
Contributor

Portugal claimed & under progress

@MaximeLaurenty
Copy link
Contributor

MaximeLaurenty commented Nov 8, 2018

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
Copy link
Contributor

Portugal done.
Sweden claimed and done.

@Makitsu
Copy link
Contributor

Makitsu commented Nov 21, 2018

Thanks for the code !
Slovakia claimed.

@MaximeLaurenty
Copy link
Contributor

Ireland claimed.

@k3lyan
Copy link
Contributor

k3lyan commented Nov 28, 2018

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

@Ban3
Copy link
Contributor

Ban3 commented Dec 4, 2019

Finland was done in #2620

@benbenben2
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Epic 📍🏭 Packager codes https://blog.openfoodfacts.org/en/news/discover-what-food-products-are-made-near-you-with-made-near-
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

6 participants