From c3b10a3008aa5d7b356d70ddad4b373d9b975d98 Mon Sep 17 00:00:00 2001 From: Michael Herman Date: Sun, 28 Aug 2016 21:46:29 -0600 Subject: [PATCH] added country code to country name, continent name script --- 33_country_code.py | 51 ++ 33_country_codes.json | 1254 +++++++++++++++++++++++++++++++++++++++++ 33_sample_csv.csv | 109 ++++ data.csv | 107 ++++ 4 files changed, 1521 insertions(+) create mode 100644 33_country_code.py create mode 100644 33_country_codes.json create mode 100644 33_sample_csv.csv create mode 100644 data.csv diff --git a/33_country_code.py b/33_country_code.py new file mode 100644 index 0000000..134236c --- /dev/null +++ b/33_country_code.py @@ -0,0 +1,51 @@ +import csv +import sys +import json + +""" +Example usage: + +$ python 33_country_code.py 33_sample_csv.csv 33_country_codes.json +""" + + +def get_data(csv_file, json_file): + countryCodes = [] + countryNames = [] + continentNames = [] + with open(csv_file, 'rt') as file_one: + reader = csv.reader(file_one) + with open(json_file) as file_two: + json_data = json.load(file_two) + all_countries = json_data["country"] + for csv_row in reader: + for json_row in all_countries: + if csv_row[0] == json_row["countryCode"]: + countryCodes.append(json_row["countryCode"]) + countryNames.append(json_row["countryName"]) + continentNames.append(json_row["continentName"]) + + return [ + countryCodes, + countryNames, + continentNames + ] + + +def write_data(array_of_arrays): + with open('data.csv', 'wt') as csv_out: + writer = csv.writer(csv_out) + rows = zip( + array_of_arrays[0], + array_of_arrays[1], + array_of_arrays[2] + ) + for row in rows: + writer.writerow(row) + + +if __name__ == '__main__': + csv_file_name = sys.argv[1] + json_file_name = sys.argv[2] + data = get_data(csv_file_name, json_file_name) + write_data(data) diff --git a/33_country_codes.json b/33_country_codes.json new file mode 100644 index 0000000..4ec79e6 --- /dev/null +++ b/33_country_codes.json @@ -0,0 +1,1254 @@ +{ + "country": [ + { + "countryCode": "AD", + "countryName": "Andorra", + "continentName": "Europe" + }, + { + "countryCode": "AE", + "countryName": "United Arab Emirates", + "continentName": "Asia" + }, + { + "countryCode": "AF", + "countryName": "Afghanistan", + "continentName": "Asia" + }, + { + "countryCode": "AG", + "countryName": "Antigua and Barbuda", + "continentName": "North America" + }, + { + "countryCode": "AI", + "countryName": "Anguilla", + "continentName": "North America" + }, + { + "countryCode": "AL", + "countryName": "Albania", + "continentName": "Europe" + }, + { + "countryCode": "AM", + "countryName": "Armenia", + "continentName": "Asia" + }, + { + "countryCode": "AO", + "countryName": "Angola", + "continentName": "Africa" + }, + { + "countryCode": "AQ", + "countryName": "Antarctica", + "continentName": "Antarctica" + }, + { + "countryCode": "AR", + "countryName": "Argentina", + "continentName": "South America" + }, + { + "countryCode": "AS", + "countryName": "American Samoa", + "continentName": "Oceania" + }, + { + "countryCode": "AT", + "countryName": "Austria", + "continentName": "Europe" + }, + { + "countryCode": "AU", + "countryName": "Australia", + "continentName": "Oceania" + }, + { + "countryCode": "AW", + "countryName": "Aruba", + "continentName": "North America" + }, + { + "countryCode": "AX", + "countryName": "Åland", + "continentName": "Europe" + }, + { + "countryCode": "AZ", + "countryName": "Azerbaijan", + "continentName": "Asia" + }, + { + "countryCode": "BA", + "countryName": "Bosnia and Herzegovina", + "continentName": "Europe" + }, + { + "countryCode": "BB", + "countryName": "Barbados", + "continentName": "North America" + }, + { + "countryCode": "BD", + "countryName": "Bangladesh", + "continentName": "Asia" + }, + { + "countryCode": "BE", + "countryName": "Belgium", + "continentName": "Europe" + }, + { + "countryCode": "BF", + "countryName": "Burkina Faso", + "continentName": "Africa" + }, + { + "countryCode": "BG", + "countryName": "Bulgaria", + "continentName": "Europe" + }, + { + "countryCode": "BH", + "countryName": "Bahrain", + "continentName": "Asia" + }, + { + "countryCode": "BI", + "countryName": "Burundi", + "continentName": "Africa" + }, + { + "countryCode": "BJ", + "countryName": "Benin", + "continentName": "Africa" + }, + { + "countryCode": "BL", + "countryName": "Saint Barthélemy", + "continentName": "North America" + }, + { + "countryCode": "BM", + "countryName": "Bermuda", + "continentName": "North America" + }, + { + "countryCode": "BN", + "countryName": "Brunei", + "continentName": "Asia" + }, + { + "countryCode": "BO", + "countryName": "Bolivia", + "continentName": "South America" + }, + { + "countryCode": "BQ", + "countryName": "Bonaire", + "continentName": "North America" + }, + { + "countryCode": "BR", + "countryName": "Brazil", + "continentName": "South America" + }, + { + "countryCode": "BS", + "countryName": "Bahamas", + "continentName": "North America" + }, + { + "countryCode": "BT", + "countryName": "Bhutan", + "continentName": "Asia" + }, + { + "countryCode": "BV", + "countryName": "Bouvet Island", + "continentName": "Antarctica" + }, + { + "countryCode": "BW", + "countryName": "Botswana", + "continentName": "Africa" + }, + { + "countryCode": "BY", + "countryName": "Belarus", + "continentName": "Europe" + }, + { + "countryCode": "BZ", + "countryName": "Belize", + "continentName": "North America" + }, + { + "countryCode": "CA", + "countryName": "Canada", + "continentName": "North America" + }, + { + "countryCode": "CC", + "countryName": "Cocos [Keeling] Islands", + "continentName": "Asia" + }, + { + "countryCode": "CD", + "countryName": "Democratic Republic of the Congo", + "continentName": "Africa" + }, + { + "countryCode": "CF", + "countryName": "Central African Republic", + "continentName": "Africa" + }, + { + "countryCode": "CG", + "countryName": "Republic of the Congo", + "continentName": "Africa" + }, + { + "countryCode": "CH", + "countryName": "Switzerland", + "continentName": "Europe" + }, + { + "countryCode": "CI", + "countryName": "Ivory Coast", + "continentName": "Africa" + }, + { + "countryCode": "CK", + "countryName": "Cook Islands", + "continentName": "Oceania" + }, + { + "countryCode": "CL", + "countryName": "Chile", + "continentName": "South America" + }, + { + "countryCode": "CM", + "countryName": "Cameroon", + "continentName": "Africa" + }, + { + "countryCode": "CN", + "countryName": "China", + "continentName": "Asia" + }, + { + "countryCode": "CO", + "countryName": "Colombia", + "continentName": "South America" + }, + { + "countryCode": "CR", + "countryName": "Costa Rica", + "continentName": "North America" + }, + { + "countryCode": "CU", + "countryName": "Cuba", + "continentName": "North America" + }, + { + "countryCode": "CV", + "countryName": "Cape Verde", + "continentName": "Africa" + }, + { + "countryCode": "CW", + "countryName": "Curacao", + "continentName": "North America" + }, + { + "countryCode": "CX", + "countryName": "Christmas Island", + "continentName": "Asia" + }, + { + "countryCode": "CY", + "countryName": "Cyprus", + "continentName": "Europe" + }, + { + "countryCode": "CZ", + "countryName": "Czechia", + "continentName": "Europe" + }, + { + "countryCode": "DE", + "countryName": "Germany", + "continentName": "Europe" + }, + { + "countryCode": "DJ", + "countryName": "Djibouti", + "continentName": "Africa" + }, + { + "countryCode": "DK", + "countryName": "Denmark", + "continentName": "Europe" + }, + { + "countryCode": "DM", + "countryName": "Dominica", + "continentName": "North America" + }, + { + "countryCode": "DO", + "countryName": "Dominican Republic", + "continentName": "North America" + }, + { + "countryCode": "DZ", + "countryName": "Algeria", + "continentName": "Africa" + }, + { + "countryCode": "EC", + "countryName": "Ecuador", + "continentName": "South America" + }, + { + "countryCode": "EE", + "countryName": "Estonia", + "continentName": "Europe" + }, + { + "countryCode": "EG", + "countryName": "Egypt", + "continentName": "Africa" + }, + { + "countryCode": "EH", + "countryName": "Western Sahara", + "continentName": "Africa" + }, + { + "countryCode": "ER", + "countryName": "Eritrea", + "continentName": "Africa" + }, + { + "countryCode": "ES", + "countryName": "Spain", + "continentName": "Europe" + }, + { + "countryCode": "ET", + "countryName": "Ethiopia", + "continentName": "Africa" + }, + { + "countryCode": "FI", + "countryName": "Finland", + "continentName": "Europe" + }, + { + "countryCode": "FJ", + "countryName": "Fiji", + "continentName": "Oceania" + }, + { + "countryCode": "FK", + "countryName": "Falkland Islands", + "continentName": "South America" + }, + { + "countryCode": "FM", + "countryName": "Micronesia", + "continentName": "Oceania" + }, + { + "countryCode": "FO", + "countryName": "Faroe Islands", + "continentName": "Europe" + }, + { + "countryCode": "FR", + "countryName": "France", + "continentName": "Europe" + }, + { + "countryCode": "GA", + "countryName": "Gabon", + "continentName": "Africa" + }, + { + "countryCode": "GB", + "countryName": "United Kingdom", + "continentName": "Europe" + }, + { + "countryCode": "GD", + "countryName": "Grenada", + "continentName": "North America" + }, + { + "countryCode": "GE", + "countryName": "Georgia", + "continentName": "Asia" + }, + { + "countryCode": "GF", + "countryName": "French Guiana", + "continentName": "South America" + }, + { + "countryCode": "GG", + "countryName": "Guernsey", + "continentName": "Europe" + }, + { + "countryCode": "GH", + "countryName": "Ghana", + "continentName": "Africa" + }, + { + "countryCode": "GI", + "countryName": "Gibraltar", + "continentName": "Europe" + }, + { + "countryCode": "GL", + "countryName": "Greenland", + "continentName": "North America" + }, + { + "countryCode": "GM", + "countryName": "Gambia", + "continentName": "Africa" + }, + { + "countryCode": "GN", + "countryName": "Guinea", + "continentName": "Africa" + }, + { + "countryCode": "GP", + "countryName": "Guadeloupe", + "continentName": "North America" + }, + { + "countryCode": "GQ", + "countryName": "Equatorial Guinea", + "continentName": "Africa" + }, + { + "countryCode": "GR", + "countryName": "Greece", + "continentName": "Europe" + }, + { + "countryCode": "GS", + "countryName": "South Georgia and the South Sandwich Islands", + "continentName": "Antarctica" + }, + { + "countryCode": "GT", + "countryName": "Guatemala", + "continentName": "North America" + }, + { + "countryCode": "GU", + "countryName": "Guam", + "continentName": "Oceania" + }, + { + "countryCode": "GW", + "countryName": "Guinea-Bissau", + "continentName": "Africa" + }, + { + "countryCode": "GY", + "countryName": "Guyana", + "continentName": "South America" + }, + { + "countryCode": "HK", + "countryName": "Hong Kong", + "continentName": "Asia" + }, + { + "countryCode": "HM", + "countryName": "Heard Island and McDonald Islands", + "continentName": "Antarctica" + }, + { + "countryCode": "HN", + "countryName": "Honduras", + "continentName": "North America" + }, + { + "countryCode": "HR", + "countryName": "Croatia", + "continentName": "Europe" + }, + { + "countryCode": "HT", + "countryName": "Haiti", + "continentName": "North America" + }, + { + "countryCode": "HU", + "countryName": "Hungary", + "continentName": "Europe" + }, + { + "countryCode": "ID", + "countryName": "Indonesia", + "continentName": "Asia" + }, + { + "countryCode": "IE", + "countryName": "Ireland", + "continentName": "Europe" + }, + { + "countryCode": "IL", + "countryName": "Israel", + "continentName": "Asia" + }, + { + "countryCode": "IM", + "countryName": "Isle of Man", + "continentName": "Europe" + }, + { + "countryCode": "IN", + "countryName": "India", + "continentName": "Asia" + }, + { + "countryCode": "IO", + "countryName": "British Indian Ocean Territory", + "continentName": "Asia" + }, + { + "countryCode": "IQ", + "countryName": "Iraq", + "continentName": "Asia" + }, + { + "countryCode": "IR", + "countryName": "Iran", + "continentName": "Asia" + }, + { + "countryCode": "IS", + "countryName": "Iceland", + "continentName": "Europe" + }, + { + "countryCode": "IT", + "countryName": "Italy", + "continentName": "Europe" + }, + { + "countryCode": "JE", + "countryName": "Jersey", + "continentName": "Europe" + }, + { + "countryCode": "JM", + "countryName": "Jamaica", + "continentName": "North America" + }, + { + "countryCode": "JO", + "countryName": "Jordan", + "continentName": "Asia" + }, + { + "countryCode": "JP", + "countryName": "Japan", + "continentName": "Asia" + }, + { + "countryCode": "KE", + "countryName": "Kenya", + "continentName": "Africa" + }, + { + "countryCode": "KG", + "countryName": "Kyrgyzstan", + "continentName": "Asia" + }, + { + "countryCode": "KH", + "countryName": "Cambodia", + "continentName": "Asia" + }, + { + "countryCode": "KI", + "countryName": "Kiribati", + "continentName": "Oceania" + }, + { + "countryCode": "KM", + "countryName": "Comoros", + "continentName": "Africa" + }, + { + "countryCode": "KN", + "countryName": "Saint Kitts and Nevis", + "continentName": "North America" + }, + { + "countryCode": "KP", + "countryName": "North Korea", + "continentName": "Asia" + }, + { + "countryCode": "KR", + "countryName": "South Korea", + "continentName": "Asia" + }, + { + "countryCode": "KW", + "countryName": "Kuwait", + "continentName": "Asia" + }, + { + "countryCode": "KY", + "countryName": "Cayman Islands", + "continentName": "North America" + }, + { + "countryCode": "KZ", + "countryName": "Kazakhstan", + "continentName": "Asia" + }, + { + "countryCode": "LA", + "countryName": "Laos", + "continentName": "Asia" + }, + { + "countryCode": "LB", + "countryName": "Lebanon", + "continentName": "Asia" + }, + { + "countryCode": "LC", + "countryName": "Saint Lucia", + "continentName": "North America" + }, + { + "countryCode": "LI", + "countryName": "Liechtenstein", + "continentName": "Europe" + }, + { + "countryCode": "LK", + "countryName": "Sri Lanka", + "continentName": "Asia" + }, + { + "countryCode": "LR", + "countryName": "Liberia", + "continentName": "Africa" + }, + { + "countryCode": "LS", + "countryName": "Lesotho", + "continentName": "Africa" + }, + { + "countryCode": "LT", + "countryName": "Lithuania", + "continentName": "Europe" + }, + { + "countryCode": "LU", + "countryName": "Luxembourg", + "continentName": "Europe" + }, + { + "countryCode": "LV", + "countryName": "Latvia", + "continentName": "Europe" + }, + { + "countryCode": "LY", + "countryName": "Libya", + "continentName": "Africa" + }, + { + "countryCode": "MA", + "countryName": "Morocco", + "continentName": "Africa" + }, + { + "countryCode": "MC", + "countryName": "Monaco", + "continentName": "Europe" + }, + { + "countryCode": "MD", + "countryName": "Moldova", + "continentName": "Europe" + }, + { + "countryCode": "ME", + "countryName": "Montenegro", + "continentName": "Europe" + }, + { + "countryCode": "MF", + "countryName": "Saint Martin", + "continentName": "North America" + }, + { + "countryCode": "MG", + "countryName": "Madagascar", + "continentName": "Africa" + }, + { + "countryCode": "MH", + "countryName": "Marshall Islands", + "continentName": "Oceania" + }, + { + "countryCode": "MK", + "countryName": "Macedonia", + "continentName": "Europe" + }, + { + "countryCode": "ML", + "countryName": "Mali", + "continentName": "Africa" + }, + { + "countryCode": "MM", + "countryName": "Myanmar [Burma]", + "continentName": "Asia" + }, + { + "countryCode": "MN", + "countryName": "Mongolia", + "continentName": "Asia" + }, + { + "countryCode": "MO", + "countryName": "Macao", + "continentName": "Asia" + }, + { + "countryCode": "MP", + "countryName": "Northern Mariana Islands", + "continentName": "Oceania" + }, + { + "countryCode": "MQ", + "countryName": "Martinique", + "continentName": "North America" + }, + { + "countryCode": "MR", + "countryName": "Mauritania", + "continentName": "Africa" + }, + { + "countryCode": "MS", + "countryName": "Montserrat", + "continentName": "North America" + }, + { + "countryCode": "MT", + "countryName": "Malta", + "continentName": "Europe" + }, + { + "countryCode": "MU", + "countryName": "Mauritius", + "continentName": "Africa" + }, + { + "countryCode": "MV", + "countryName": "Maldives", + "continentName": "Asia" + }, + { + "countryCode": "MW", + "countryName": "Malawi", + "continentName": "Africa" + }, + { + "countryCode": "MX", + "countryName": "Mexico", + "continentName": "North America" + }, + { + "countryCode": "MY", + "countryName": "Malaysia", + "continentName": "Asia" + }, + { + "countryCode": "MZ", + "countryName": "Mozambique", + "continentName": "Africa" + }, + { + "countryCode": "NA", + "countryName": "Namibia", + "continentName": "Africa" + }, + { + "countryCode": "NC", + "countryName": "New Caledonia", + "continentName": "Oceania" + }, + { + "countryCode": "NE", + "countryName": "Niger", + "continentName": "Africa" + }, + { + "countryCode": "NF", + "countryName": "Norfolk Island", + "continentName": "Oceania" + }, + { + "countryCode": "NG", + "countryName": "Nigeria", + "continentName": "Africa" + }, + { + "countryCode": "NI", + "countryName": "Nicaragua", + "continentName": "North America" + }, + { + "countryCode": "NL", + "countryName": "Netherlands", + "continentName": "Europe" + }, + { + "countryCode": "NO", + "countryName": "Norway", + "continentName": "Europe" + }, + { + "countryCode": "NP", + "countryName": "Nepal", + "continentName": "Asia" + }, + { + "countryCode": "NR", + "countryName": "Nauru", + "continentName": "Oceania" + }, + { + "countryCode": "NU", + "countryName": "Niue", + "continentName": "Oceania" + }, + { + "countryCode": "NZ", + "countryName": "New Zealand", + "continentName": "Oceania" + }, + { + "countryCode": "OM", + "countryName": "Oman", + "continentName": "Asia" + }, + { + "countryCode": "PA", + "countryName": "Panama", + "continentName": "North America" + }, + { + "countryCode": "PE", + "countryName": "Peru", + "continentName": "South America" + }, + { + "countryCode": "PF", + "countryName": "French Polynesia", + "continentName": "Oceania" + }, + { + "countryCode": "PG", + "countryName": "Papua New Guinea", + "continentName": "Oceania" + }, + { + "countryCode": "PH", + "countryName": "Philippines", + "continentName": "Asia" + }, + { + "countryCode": "PK", + "countryName": "Pakistan", + "continentName": "Asia" + }, + { + "countryCode": "PL", + "countryName": "Poland", + "continentName": "Europe" + }, + { + "countryCode": "PM", + "countryName": "Saint Pierre and Miquelon", + "continentName": "North America" + }, + { + "countryCode": "PN", + "countryName": "Pitcairn Islands", + "continentName": "Oceania" + }, + { + "countryCode": "PR", + "countryName": "Puerto Rico", + "continentName": "North America" + }, + { + "countryCode": "PS", + "countryName": "Palestine", + "continentName": "Asia" + }, + { + "countryCode": "PT", + "countryName": "Portugal", + "continentName": "Europe" + }, + { + "countryCode": "PW", + "countryName": "Palau", + "continentName": "Oceania" + }, + { + "countryCode": "PY", + "countryName": "Paraguay", + "continentName": "South America" + }, + { + "countryCode": "QA", + "countryName": "Qatar", + "continentName": "Asia" + }, + { + "countryCode": "RE", + "countryName": "Réunion", + "continentName": "Africa" + }, + { + "countryCode": "RO", + "countryName": "Romania", + "continentName": "Europe" + }, + { + "countryCode": "RS", + "countryName": "Serbia", + "continentName": "Europe" + }, + { + "countryCode": "RU", + "countryName": "Russia", + "continentName": "Europe" + }, + { + "countryCode": "RW", + "countryName": "Rwanda", + "continentName": "Africa" + }, + { + "countryCode": "SA", + "countryName": "Saudi Arabia", + "continentName": "Asia" + }, + { + "countryCode": "SB", + "countryName": "Solomon Islands", + "continentName": "Oceania" + }, + { + "countryCode": "SC", + "countryName": "Seychelles", + "continentName": "Africa" + }, + { + "countryCode": "SD", + "countryName": "Sudan", + "continentName": "Africa" + }, + { + "countryCode": "SE", + "countryName": "Sweden", + "continentName": "Europe" + }, + { + "countryCode": "SG", + "countryName": "Singapore", + "continentName": "Asia" + }, + { + "countryCode": "SH", + "countryName": "Saint Helena", + "continentName": "Africa" + }, + { + "countryCode": "SI", + "countryName": "Slovenia", + "continentName": "Europe" + }, + { + "countryCode": "SJ", + "countryName": "Svalbard and Jan Mayen", + "continentName": "Europe" + }, + { + "countryCode": "SK", + "countryName": "Slovakia", + "continentName": "Europe" + }, + { + "countryCode": "SL", + "countryName": "Sierra Leone", + "continentName": "Africa" + }, + { + "countryCode": "SM", + "countryName": "San Marino", + "continentName": "Europe" + }, + { + "countryCode": "SN", + "countryName": "Senegal", + "continentName": "Africa" + }, + { + "countryCode": "SO", + "countryName": "Somalia", + "continentName": "Africa" + }, + { + "countryCode": "SR", + "countryName": "Suriname", + "continentName": "South America" + }, + { + "countryCode": "SS", + "countryName": "South Sudan", + "continentName": "Africa" + }, + { + "countryCode": "ST", + "countryName": "São Tomé and Príncipe", + "continentName": "Africa" + }, + { + "countryCode": "SV", + "countryName": "El Salvador", + "continentName": "North America" + }, + { + "countryCode": "SX", + "countryName": "Sint Maarten", + "continentName": "North America" + }, + { + "countryCode": "SY", + "countryName": "Syria", + "continentName": "Asia" + }, + { + "countryCode": "SZ", + "countryName": "Swaziland", + "continentName": "Africa" + }, + { + "countryCode": "TC", + "countryName": "Turks and Caicos Islands", + "continentName": "North America" + }, + { + "countryCode": "TD", + "countryName": "Chad", + "continentName": "Africa" + }, + { + "countryCode": "TF", + "countryName": "French Southern Territories", + "continentName": "Antarctica" + }, + { + "countryCode": "TG", + "countryName": "Togo", + "continentName": "Africa" + }, + { + "countryCode": "TH", + "countryName": "Thailand", + "continentName": "Asia" + }, + { + "countryCode": "TJ", + "countryName": "Tajikistan", + "continentName": "Asia" + }, + { + "countryCode": "TK", + "countryName": "Tokelau", + "continentName": "Oceania" + }, + { + "countryCode": "TL", + "countryName": "East Timor", + "continentName": "Oceania" + }, + { + "countryCode": "TM", + "countryName": "Turkmenistan", + "continentName": "Asia" + }, + { + "countryCode": "TN", + "countryName": "Tunisia", + "continentName": "Africa" + }, + { + "countryCode": "TO", + "countryName": "Tonga", + "continentName": "Oceania" + }, + { + "countryCode": "TR", + "countryName": "Turkey", + "continentName": "Asia" + }, + { + "countryCode": "TT", + "countryName": "Trinidad and Tobago", + "continentName": "North America" + }, + { + "countryCode": "TV", + "countryName": "Tuvalu", + "continentName": "Oceania" + }, + { + "countryCode": "TW", + "countryName": "Taiwan", + "continentName": "Asia" + }, + { + "countryCode": "TZ", + "countryName": "Tanzania", + "continentName": "Africa" + }, + { + "countryCode": "UA", + "countryName": "Ukraine", + "continentName": "Europe" + }, + { + "countryCode": "UG", + "countryName": "Uganda", + "continentName": "Africa" + }, + { + "countryCode": "UM", + "countryName": "U.S. Minor Outlying Islands", + "continentName": "Oceania" + }, + { + "countryCode": "US", + "countryName": "United States", + "continentName": "North America" + }, + { + "countryCode": "UY", + "countryName": "Uruguay", + "continentName": "South America" + }, + { + "countryCode": "UZ", + "countryName": "Uzbekistan", + "continentName": "Asia" + }, + { + "countryCode": "VA", + "countryName": "Vatican City", + "continentName": "Europe" + }, + { + "countryCode": "VC", + "countryName": "Saint Vincent and the Grenadines", + "continentName": "North America" + }, + { + "countryCode": "VE", + "countryName": "Venezuela", + "continentName": "South America" + }, + { + "countryCode": "VG", + "countryName": "British Virgin Islands", + "continentName": "North America" + }, + { + "countryCode": "VI", + "countryName": "U.S. Virgin Islands", + "continentName": "North America" + }, + { + "countryCode": "VN", + "countryName": "Vietnam", + "continentName": "Asia" + }, + { + "countryCode": "VU", + "countryName": "Vanuatu", + "continentName": "Oceania" + }, + { + "countryCode": "WF", + "countryName": "Wallis and Futuna", + "continentName": "Oceania" + }, + { + "countryCode": "WS", + "countryName": "Samoa", + "continentName": "Oceania" + }, + { + "countryCode": "XK", + "countryName": "Kosovo", + "continentName": "Europe" + }, + { + "countryCode": "YE", + "countryName": "Yemen", + "continentName": "Asia" + }, + { + "countryCode": "YT", + "countryName": "Mayotte", + "continentName": "Africa" + }, + { + "countryCode": "ZA", + "countryName": "South Africa", + "continentName": "Africa" + }, + { + "countryCode": "ZM", + "countryName": "Zambia", + "continentName": "Africa" + }, + { + "countryCode": "ZW", + "countryName": "Zimbabwe", + "continentName": "Africa" + } + ] +} diff --git a/33_sample_csv.csv b/33_sample_csv.csv new file mode 100644 index 0000000..62b23a2 --- /dev/null +++ b/33_sample_csv.csv @@ -0,0 +1,109 @@ +A2 +AE +AL +AP +AR +AT +AU +AZ +BA +BD +BE +BG +BH +BN +BR +BY +CA +CH +CL +CN +CO +CR +CW +CY +CZ +DE +DK +DO +EC +EE +ES +FI +FR +GB +GE +GG +GH +GI +GR +GT +HK +HR +HT +HU +ID +IE +IL +IN +IS +IT +JM +JO +JP +KE +KG +KR +KW +KY +KZ +LA +LB +LK +LT +LU +LV +MD +MG +MK +MO +MT +MV +MX +MY +NC +NG +NI +NL +NO +NP +NZ +OM +PA +PE +PH +PK +PL +PR +PT +PY +RO +RS +RU +SA +SE +SG +SI +SK +SO +TH +TR +TW +TZ +UA +US +UY +VN +VU +ZA +ZW diff --git a/data.csv b/data.csv new file mode 100644 index 0000000..3f0c610 --- /dev/null +++ b/data.csv @@ -0,0 +1,107 @@ +AE,United Arab Emirates,Asia +AL,Albania,Europe +AR,Argentina,South America +AT,Austria,Europe +AU,Australia,Oceania +AZ,Azerbaijan,Asia +BA,Bosnia and Herzegovina,Europe +BD,Bangladesh,Asia +BE,Belgium,Europe +BG,Bulgaria,Europe +BH,Bahrain,Asia +BN,Brunei,Asia +BR,Brazil,South America +BY,Belarus,Europe +CA,Canada,North America +CH,Switzerland,Europe +CL,Chile,South America +CN,China,Asia +CO,Colombia,South America +CR,Costa Rica,North America +CW,Curacao,North America +CY,Cyprus,Europe +CZ,Czechia,Europe +DE,Germany,Europe +DK,Denmark,Europe +DO,Dominican Republic,North America +EC,Ecuador,South America +EE,Estonia,Europe +ES,Spain,Europe +FI,Finland,Europe +FR,France,Europe +GB,United Kingdom,Europe +GE,Georgia,Asia +GG,Guernsey,Europe +GH,Ghana,Africa +GI,Gibraltar,Europe +GR,Greece,Europe +GT,Guatemala,North America +HK,Hong Kong,Asia +HR,Croatia,Europe +HT,Haiti,North America +HU,Hungary,Europe +ID,Indonesia,Asia +IE,Ireland,Europe +IL,Israel,Asia +IN,India,Asia +IS,Iceland,Europe +IT,Italy,Europe +JM,Jamaica,North America +JO,Jordan,Asia +JP,Japan,Asia +KE,Kenya,Africa +KG,Kyrgyzstan,Asia +KR,South Korea,Asia +KW,Kuwait,Asia +KY,Cayman Islands,North America +KZ,Kazakhstan,Asia +LA,Laos,Asia +LB,Lebanon,Asia +LK,Sri Lanka,Asia +LT,Lithuania,Europe +LU,Luxembourg,Europe +LV,Latvia,Europe +MD,Moldova,Europe +MG,Madagascar,Africa +MK,Macedonia,Europe +MO,Macao,Asia +MT,Malta,Europe +MV,Maldives,Asia +MX,Mexico,North America +MY,Malaysia,Asia +NC,New Caledonia,Oceania +NG,Nigeria,Africa +NI,Nicaragua,North America +NL,Netherlands,Europe +NO,Norway,Europe +NP,Nepal,Asia +NZ,New Zealand,Oceania +OM,Oman,Asia +PA,Panama,North America +PE,Peru,South America +PH,Philippines,Asia +PK,Pakistan,Asia +PL,Poland,Europe +PR,Puerto Rico,North America +PT,Portugal,Europe +PY,Paraguay,South America +RO,Romania,Europe +RS,Serbia,Europe +RU,Russia,Europe +SA,Saudi Arabia,Asia +SE,Sweden,Europe +SG,Singapore,Asia +SI,Slovenia,Europe +SK,Slovakia,Europe +SO,Somalia,Africa +TH,Thailand,Asia +TR,Turkey,Asia +TW,Taiwan,Asia +TZ,Tanzania,Africa +UA,Ukraine,Europe +US,United States,North America +UY,Uruguay,South America +VN,Vietnam,Asia +VU,Vanuatu,Oceania +ZA,South Africa,Africa +ZW,Zimbabwe,Africa