From c448fc2b180d9e4ec001e43aacabffc340286be8 Mon Sep 17 00:00:00 2001 From: harisabdullah Date: Sun, 19 Nov 2023 19:49:11 +0500 Subject: [PATCH 01/15] Moving from JSON files to in memory data structures --- ipinfo/{continent.json => continent.py} | 4 +- ipinfo/countries.json | 1 - ipinfo/countries.py | 3 + ipinfo/currency.json | 252 ------------------------ ipinfo/currency.py | 252 ++++++++++++++++++++++++ ipinfo/eu.json | 1 - ipinfo/eu.py | 2 + ipinfo/flags.json | 252 ------------------------ ipinfo/flags.py | 252 ++++++++++++++++++++++++ ipinfo/handler.py | 40 +--- ipinfo/handler_async.py | 40 +--- ipinfo/handler_utils.py | 12 -- 12 files changed, 532 insertions(+), 579 deletions(-) rename ipinfo/{continent.json => continent.py} (99%) delete mode 100644 ipinfo/countries.json create mode 100644 ipinfo/countries.py delete mode 100644 ipinfo/currency.json create mode 100644 ipinfo/currency.py delete mode 100644 ipinfo/eu.json create mode 100644 ipinfo/eu.py delete mode 100644 ipinfo/flags.json create mode 100644 ipinfo/flags.py diff --git a/ipinfo/continent.json b/ipinfo/continent.py similarity index 99% rename from ipinfo/continent.json rename to ipinfo/continent.py index 9baa1f2..59ad265 100644 --- a/ipinfo/continent.json +++ b/ipinfo/continent.py @@ -1,4 +1,4 @@ -{ +continents = { "BD": {"code": "AS", "name": "Asia"}, "BE": {"code": "EU", "name": "Europe"}, "BF": {"code": "AF", "name": "Africa"}, @@ -250,4 +250,6 @@ "QA": {"code": "AS", "name": "Asia"}, "MZ": {"code": "AF", "name": "Africa"} } + + \ No newline at end of file diff --git a/ipinfo/countries.json b/ipinfo/countries.json deleted file mode 100644 index e9c6f71..0000000 --- a/ipinfo/countries.json +++ /dev/null @@ -1 +0,0 @@ -{"BD": "Bangladesh", "BE": "Belgium", "BF": "Burkina Faso", "BG": "Bulgaria", "BA": "Bosnia and Herzegovina", "BB": "Barbados", "WF": "Wallis and Futuna", "BL": "Saint Barthelemy", "BM": "Bermuda", "BN": "Brunei", "BO": "Bolivia", "BH": "Bahrain", "BI": "Burundi", "BJ": "Benin", "BT": "Bhutan", "JM": "Jamaica", "BV": "Bouvet Island", "BW": "Botswana", "WS": "Samoa", "BQ": "Bonaire, Saint Eustatius and Saba ", "BR": "Brazil", "BS": "Bahamas", "JE": "Jersey", "BY": "Belarus", "BZ": "Belize", "RU": "Russia", "RW": "Rwanda", "RS": "Serbia", "TL": "East Timor", "RE": "Reunion", "TM": "Turkmenistan", "TJ": "Tajikistan", "RO": "Romania", "TK": "Tokelau", "GW": "Guinea-Bissau", "GU": "Guam", "GT": "Guatemala", "GS": "South Georgia and the South Sandwich Islands", "GR": "Greece", "GQ": "Equatorial Guinea", "GP": "Guadeloupe", "JP": "Japan", "GY": "Guyana", "GG": "Guernsey", "GF": "French Guiana", "GE": "Georgia", "GD": "Grenada", "GB": "United Kingdom", "GA": "Gabon", "SV": "El Salvador", "GN": "Guinea", "GM": "Gambia", "GL": "Greenland", "GI": "Gibraltar", "GH": "Ghana", "OM": "Oman", "TN": "Tunisia", "JO": "Jordan", "HR": "Croatia", "HT": "Haiti", "HU": "Hungary", "HK": "Hong Kong", "HN": "Honduras", "HM": "Heard Island and McDonald Islands", "VE": "Venezuela", "PR": "Puerto Rico", "PS": "Palestinian Territory", "PW": "Palau", "PT": "Portugal", "SJ": "Svalbard and Jan Mayen", "PY": "Paraguay", "IQ": "Iraq", "PA": "Panama", "PF": "French Polynesia", "PG": "Papua New Guinea", "PE": "Peru", "PK": "Pakistan", "PH": "Philippines", "PN": "Pitcairn", "PL": "Poland", "PM": "Saint Pierre and Miquelon", "ZM": "Zambia", "EH": "Western Sahara", "EE": "Estonia", "EG": "Egypt", "ZA": "South Africa", "EC": "Ecuador", "IT": "Italy", "VN": "Vietnam", "SB": "Solomon Islands", "ET": "Ethiopia", "SO": "Somalia", "ZW": "Zimbabwe", "SA": "Saudi Arabia", "ES": "Spain", "ER": "Eritrea", "ME": "Montenegro", "MD": "Moldova", "MG": "Madagascar", "MF": "Saint Martin", "MA": "Morocco", "MC": "Monaco", "UZ": "Uzbekistan", "MM": "Myanmar", "ML": "Mali", "MO": "Macao", "MN": "Mongolia", "MH": "Marshall Islands", "MK": "Macedonia", "MU": "Mauritius", "MT": "Malta", "MW": "Malawi", "MV": "Maldives", "MQ": "Martinique", "MP": "Northern Mariana Islands", "MS": "Montserrat", "MR": "Mauritania", "IM": "Isle of Man", "UG": "Uganda", "TZ": "Tanzania", "MY": "Malaysia", "MX": "Mexico", "IL": "Israel", "FR": "France", "IO": "British Indian Ocean Territory", "SH": "Saint Helena", "FI": "Finland", "FJ": "Fiji", "FK": "Falkland Islands", "FM": "Micronesia", "FO": "Faroe Islands", "NI": "Nicaragua", "NL": "Netherlands", "NO": "Norway", "NA": "Namibia", "VU": "Vanuatu", "NC": "New Caledonia", "NE": "Niger", "NF": "Norfolk Island", "NG": "Nigeria", "NZ": "New Zealand", "NP": "Nepal", "NR": "Nauru", "NU": "Niue", "CK": "Cook Islands", "XK": "Kosovo", "CI": "Ivory Coast", "CH": "Switzerland", "CO": "Colombia", "CN": "China", "CM": "Cameroon", "CL": "Chile", "CC": "Cocos Islands", "CA": "Canada", "CG": "Republic of the Congo", "CF": "Central African Republic", "CD": "Democratic Republic of the Congo", "CZ": "Czech Republic", "CY": "Cyprus", "CX": "Christmas Island", "CR": "Costa Rica", "CW": "Curacao", "CV": "Cape Verde", "CU": "Cuba", "SZ": "Swaziland", "SY": "Syria", "SX": "Sint Maarten", "KG": "Kyrgyzstan", "KE": "Kenya", "SS": "South Sudan", "SR": "Suriname", "KI": "Kiribati", "KH": "Cambodia", "KN": "Saint Kitts and Nevis", "KM": "Comoros", "ST": "Sao Tome and Principe", "SK": "Slovakia", "KR": "South Korea", "SI": "Slovenia", "KP": "North Korea", "KW": "Kuwait", "SN": "Senegal", "SM": "San Marino", "SL": "Sierra Leone", "SC": "Seychelles", "KZ": "Kazakhstan", "KY": "Cayman Islands", "SG": "Singapore", "SE": "Sweden", "SD": "Sudan", "DO": "Dominican Republic", "DM": "Dominica", "DJ": "Djibouti", "DK": "Denmark", "VG": "British Virgin Islands", "DE": "Germany", "YE": "Yemen", "DZ": "Algeria", "US": "United States", "UY": "Uruguay", "YT": "Mayotte", "UM": "United States Minor Outlying Islands", "LB": "Lebanon", "LC": "Saint Lucia", "LA": "Laos", "TV": "Tuvalu", "TW": "Taiwan", "TT": "Trinidad and Tobago", "TR": "Turkey", "LK": "Sri Lanka", "LI": "Liechtenstein", "LV": "Latvia", "TO": "Tonga", "LT": "Lithuania", "LU": "Luxembourg", "LR": "Liberia", "LS": "Lesotho", "TH": "Thailand", "TF": "French Southern Territories", "TG": "Togo", "TD": "Chad", "TC": "Turks and Caicos Islands", "LY": "Libya", "VA": "Vatican", "VC": "Saint Vincent and the Grenadines", "AE": "United Arab Emirates", "AD": "Andorra", "AG": "Antigua and Barbuda", "AF": "Afghanistan", "AI": "Anguilla", "VI": "U.S. Virgin Islands", "IS": "Iceland", "IR": "Iran", "AM": "Armenia", "AL": "Albania", "AO": "Angola", "AQ": "Antarctica", "AS": "American Samoa", "AR": "Argentina", "AU": "Australia", "AT": "Austria", "AW": "Aruba", "IN": "India", "AX": "Aland Islands", "AZ": "Azerbaijan", "IE": "Ireland", "ID": "Indonesia", "UA": "Ukraine", "QA": "Qatar", "MZ": "Mozambique"} diff --git a/ipinfo/countries.py b/ipinfo/countries.py new file mode 100644 index 0000000..652aa0d --- /dev/null +++ b/ipinfo/countries.py @@ -0,0 +1,3 @@ +# Used to transform incoming responses with country abbreviations into the full +# expanded country name, e.g. "PK" -> "Pakistan". +countries = {"BD": "Bangladesh", "BE": "Belgium", "BF": "Burkina Faso", "BG": "Bulgaria", "BA": "Bosnia and Herzegovina", "BB": "Barbados", "WF": "Wallis and Futuna", "BL": "Saint Barthelemy", "BM": "Bermuda", "BN": "Brunei", "BO": "Bolivia", "BH": "Bahrain", "BI": "Burundi", "BJ": "Benin", "BT": "Bhutan", "JM": "Jamaica", "BV": "Bouvet Island", "BW": "Botswana", "WS": "Samoa", "BQ": "Bonaire, Saint Eustatius and Saba ", "BR": "Brazil", "BS": "Bahamas", "JE": "Jersey", "BY": "Belarus", "BZ": "Belize", "RU": "Russia", "RW": "Rwanda", "RS": "Serbia", "TL": "East Timor", "RE": "Reunion", "TM": "Turkmenistan", "TJ": "Tajikistan", "RO": "Romania", "TK": "Tokelau", "GW": "Guinea-Bissau", "GU": "Guam", "GT": "Guatemala", "GS": "South Georgia and the South Sandwich Islands", "GR": "Greece", "GQ": "Equatorial Guinea", "GP": "Guadeloupe", "JP": "Japan", "GY": "Guyana", "GG": "Guernsey", "GF": "French Guiana", "GE": "Georgia", "GD": "Grenada", "GB": "United Kingdom", "GA": "Gabon", "SV": "El Salvador", "GN": "Guinea", "GM": "Gambia", "GL": "Greenland", "GI": "Gibraltar", "GH": "Ghana", "OM": "Oman", "TN": "Tunisia", "JO": "Jordan", "HR": "Croatia", "HT": "Haiti", "HU": "Hungary", "HK": "Hong Kong", "HN": "Honduras", "HM": "Heard Island and McDonald Islands", "VE": "Venezuela", "PR": "Puerto Rico", "PS": "Palestinian Territory", "PW": "Palau", "PT": "Portugal", "SJ": "Svalbard and Jan Mayen", "PY": "Paraguay", "IQ": "Iraq", "PA": "Panama", "PF": "French Polynesia", "PG": "Papua New Guinea", "PE": "Peru", "PK": "Pakistan", "PH": "Philippines", "PN": "Pitcairn", "PL": "Poland", "PM": "Saint Pierre and Miquelon", "ZM": "Zambia", "EH": "Western Sahara", "EE": "Estonia", "EG": "Egypt", "ZA": "South Africa", "EC": "Ecuador", "IT": "Italy", "VN": "Vietnam", "SB": "Solomon Islands", "ET": "Ethiopia", "SO": "Somalia", "ZW": "Zimbabwe", "SA": "Saudi Arabia", "ES": "Spain", "ER": "Eritrea", "ME": "Montenegro", "MD": "Moldova", "MG": "Madagascar", "MF": "Saint Martin", "MA": "Morocco", "MC": "Monaco", "UZ": "Uzbekistan", "MM": "Myanmar", "ML": "Mali", "MO": "Macao", "MN": "Mongolia", "MH": "Marshall Islands", "MK": "Macedonia", "MU": "Mauritius", "MT": "Malta", "MW": "Malawi", "MV": "Maldives", "MQ": "Martinique", "MP": "Northern Mariana Islands", "MS": "Montserrat", "MR": "Mauritania", "IM": "Isle of Man", "UG": "Uganda", "TZ": "Tanzania", "MY": "Malaysia", "MX": "Mexico", "IL": "Israel", "FR": "France", "IO": "British Indian Ocean Territory", "SH": "Saint Helena", "FI": "Finland", "FJ": "Fiji", "FK": "Falkland Islands", "FM": "Micronesia", "FO": "Faroe Islands", "NI": "Nicaragua", "NL": "Netherlands", "NO": "Norway", "NA": "Namibia", "VU": "Vanuatu", "NC": "New Caledonia", "NE": "Niger", "NF": "Norfolk Island", "NG": "Nigeria", "NZ": "New Zealand", "NP": "Nepal", "NR": "Nauru", "NU": "Niue", "CK": "Cook Islands", "XK": "Kosovo", "CI": "Ivory Coast", "CH": "Switzerland", "CO": "Colombia", "CN": "China", "CM": "Cameroon", "CL": "Chile", "CC": "Cocos Islands", "CA": "Canada", "CG": "Republic of the Congo", "CF": "Central African Republic", "CD": "Democratic Republic of the Congo", "CZ": "Czech Republic", "CY": "Cyprus", "CX": "Christmas Island", "CR": "Costa Rica", "CW": "Curacao", "CV": "Cape Verde", "CU": "Cuba", "SZ": "Swaziland", "SY": "Syria", "SX": "Sint Maarten", "KG": "Kyrgyzstan", "KE": "Kenya", "SS": "South Sudan", "SR": "Suriname", "KI": "Kiribati", "KH": "Cambodia", "KN": "Saint Kitts and Nevis", "KM": "Comoros", "ST": "Sao Tome and Principe", "SK": "Slovakia", "KR": "South Korea", "SI": "Slovenia", "KP": "North Korea", "KW": "Kuwait", "SN": "Senegal", "SM": "San Marino", "SL": "Sierra Leone", "SC": "Seychelles", "KZ": "Kazakhstan", "KY": "Cayman Islands", "SG": "Singapore", "SE": "Sweden", "SD": "Sudan", "DO": "Dominican Republic", "DM": "Dominica", "DJ": "Djibouti", "DK": "Denmark", "VG": "British Virgin Islands", "DE": "Germany", "YE": "Yemen", "DZ": "Algeria", "US": "United States", "UY": "Uruguay", "YT": "Mayotte", "UM": "United States Minor Outlying Islands", "LB": "Lebanon", "LC": "Saint Lucia", "LA": "Laos", "TV": "Tuvalu", "TW": "Taiwan", "TT": "Trinidad and Tobago", "TR": "Turkey", "LK": "Sri Lanka", "LI": "Liechtenstein", "LV": "Latvia", "TO": "Tonga", "LT": "Lithuania", "LU": "Luxembourg", "LR": "Liberia", "LS": "Lesotho", "TH": "Thailand", "TF": "French Southern Territories", "TG": "Togo", "TD": "Chad", "TC": "Turks and Caicos Islands", "LY": "Libya", "VA": "Vatican", "VC": "Saint Vincent and the Grenadines", "AE": "United Arab Emirates", "AD": "Andorra", "AG": "Antigua and Barbuda", "AF": "Afghanistan", "AI": "Anguilla", "VI": "U.S. Virgin Islands", "IS": "Iceland", "IR": "Iran", "AM": "Armenia", "AL": "Albania", "AO": "Angola", "AQ": "Antarctica", "AS": "American Samoa", "AR": "Argentina", "AU": "Australia", "AT": "Austria", "AW": "Aruba", "IN": "India", "AX": "Aland Islands", "AZ": "Azerbaijan", "IE": "Ireland", "ID": "Indonesia", "UA": "Ukraine", "QA": "Qatar", "MZ": "Mozambique"} diff --git a/ipinfo/currency.json b/ipinfo/currency.json deleted file mode 100644 index 67198b5..0000000 --- a/ipinfo/currency.json +++ /dev/null @@ -1,252 +0,0 @@ -{ - "AD" : { "code": "EUR" ,"symbol": "€"}, - "AE" : { "code": "AED" ,"symbol": "د.إ"}, - "AF" : { "code": "AFN" ,"symbol": "؋"}, - "AG" : { "code": "XCD" ,"symbol": "$"}, - "AI" : { "code": "XCD" ,"symbol": "$"}, - "AL" : { "code": "ALL" ,"symbol": "L"}, - "AM" : { "code": "AMD" ,"symbol": "֏"}, - "AO" : { "code": "AOA" ,"symbol": "Kz"}, - "AQ" : { "code": "" ,"symbol": "$"}, - "AR" : { "code": "ARS" ,"symbol": "$"}, - "AS" : { "code": "USD" ,"symbol": "$"}, - "AT" : { "code": "EUR" ,"symbol": "€"}, - "AU" : { "code": "AUD" ,"symbol": "$"}, - "AW" : { "code": "AWG" ,"symbol": "ƒ"}, - "AX" : { "code": "EUR" ,"symbol": "€"}, - "AZ" : { "code": "AZN" ,"symbol": "₼"}, - "BA" : { "code": "BAM" ,"symbol": "KM"}, - "BB" : { "code": "BBD" ,"symbol": "$"}, - "BD" : { "code": "BDT" ,"symbol": "৳"}, - "BE" : { "code": "EUR" ,"symbol": "€"}, - "BF" : { "code": "XOF" ,"symbol": "CFA"}, - "BG" : { "code": "BGN" ,"symbol": "лв"}, - "BH" : { "code": "BHD" ,"symbol": ".د.ب"}, - "BI" : { "code": "BIF" ,"symbol": "FBu"}, - "BJ" : { "code": "XOF" ,"symbol": "CFA"}, - "BL" : { "code": "EUR" ,"symbol": "€"}, - "BM" : { "code": "BMD" ,"symbol": "$"}, - "BN" : { "code": "BND" ,"symbol": "$"}, - "BO" : { "code": "BOB" ,"symbol": "$b"}, - "BQ" : { "code": "USD" ,"symbol": "$"}, - "BR" : { "code": "BRL" ,"symbol": "R$"}, - "BS" : { "code": "BSD" ,"symbol": "$"}, - "BT" : { "code": "BTN" ,"symbol": "Nu."}, - "BV" : { "code": "NOK" ,"symbol": "kr"}, - "BW" : { "code": "BWP" ,"symbol": "P"}, - "BY" : { "code": "BYR" ,"symbol": "Br"}, - "BZ" : { "code": "BZD" ,"symbol": "BZ$"}, - "CA" : { "code": "CAD" ,"symbol": "$"}, - "CC" : { "code": "AUD" ,"symbol": "$"}, - "CD" : { "code": "CDF" ,"symbol": "FC"}, - "CF" : { "code": "XAF" ,"symbol": "FCFA"}, - "CG" : { "code": "XAF" ,"symbol": "FCFA"}, - "CH" : { "code": "CHF" ,"symbol": "CHF"}, - "CI" : { "code": "XOF" ,"symbol": "CFA"}, - "CK" : { "code": "NZD" ,"symbol": "$"}, - "CL" : { "code": "CLP" ,"symbol": "$"}, - "CM" : { "code": "XAF" ,"symbol": "FCFA"}, - "CN" : { "code": "CNY" ,"symbol": "¥"}, - "CO" : { "code": "COP" ,"symbol": "$"}, - "CR" : { "code": "CRC" ,"symbol": "₡"}, - "CU" : { "code": "CUP" ,"symbol": "₱"}, - "CV" : { "code": "CVE" ,"symbol": "$"}, - "CW" : { "code": "ANG" ,"symbol": "ƒ"}, - "CX" : { "code": "AUD" ,"symbol": "$"}, - "CY" : { "code": "EUR" ,"symbol": "€"}, - "CZ" : { "code": "CZK" ,"symbol": "Kč"}, - "DE" : { "code": "EUR" ,"symbol": "€"}, - "DJ" : { "code": "DJF" ,"symbol": "Fdj"}, - "DK" : { "code": "DKK" ,"symbol": "kr"}, - "DM" : { "code": "XCD" ,"symbol": "$"}, - "DO" : { "code": "DOP" ,"symbol": "RD$"}, - "DZ" : { "code": "DZD" ,"symbol": "دج"}, - "EC" : { "code": "USD" ,"symbol": "$"}, - "EE" : { "code": "EUR" ,"symbol": "€"}, - "EG" : { "code": "EGP" ,"symbol": "£"}, - "EH" : { "code": "MAD" ,"symbol": "MAD"}, - "ER" : { "code": "ERN" ,"symbol": "Nfk"}, - "ES" : { "code": "EUR" ,"symbol": "€"}, - "ET" : { "code": "ETB" ,"symbol": "Br"}, - "FI" : { "code": "EUR" ,"symbol": "€"}, - "FJ" : { "code": "FJD" ,"symbol": "$"}, - "FK" : { "code": "FKP" ,"symbol": "£"}, - "FM" : { "code": "USD" ,"symbol": "$"}, - "FO" : { "code": "DKK" ,"symbol": "kr"}, - "FR" : { "code": "EUR" ,"symbol": "€"}, - "GA" : { "code": "XAF" ,"symbol": "FCFA"}, - "GB" : { "code": "GBP" ,"symbol": "£"}, - "GD" : { "code": "XCD" ,"symbol": "$"}, - "GE" : { "code": "GEL" ,"symbol": "ლ"}, - "GF" : { "code": "EUR" ,"symbol": "€"}, - "GG" : { "code": "GBP" ,"symbol": "£"}, - "GH" : { "code": "GHS" ,"symbol": "GH₵"}, - "GI" : { "code": "GIP" ,"symbol": "£"}, - "GL" : { "code": "DKK" ,"symbol": "kr"}, - "GM" : { "code": "GMD" ,"symbol": "D"}, - "GN" : { "code": "GNF" ,"symbol": "FG"}, - "GP" : { "code": "EUR" ,"symbol": "€"}, - "GQ" : { "code": "XAF" ,"symbol": "FCFA"}, - "GR" : { "code": "EUR" ,"symbol": "€"}, - "GS" : { "code": "GBP" ,"symbol": "£"}, - "GT" : { "code": "GTQ" ,"symbol": "Q"}, - "GU" : { "code": "USD" ,"symbol": "$"}, - "GW" : { "code": "XOF" ,"symbol": "CFA"}, - "GY" : { "code": "GYD" ,"symbol": "$"}, - "HK" : { "code": "HKD" ,"symbol": "$"}, - "HM" : { "code": "AUD" ,"symbol": "$"}, - "HN" : { "code": "HNL" ,"symbol": "L"}, - "HR" : { "code": "HRK" ,"symbol": "kn"}, - "HT" : { "code": "HTG" ,"symbol": "G"}, - "HU" : { "code": "HUF" ,"symbol": "Ft"}, - "ID" : { "code": "IDR" ,"symbol": "Rp"}, - "IE" : { "code": "EUR" ,"symbol": "€"}, - "IL" : { "code": "ILS" ,"symbol": "₪"}, - "IM" : { "code": "GBP" ,"symbol": "£"}, - "IN" : { "code": "INR" ,"symbol": "₹"}, - "IO" : { "code": "USD" ,"symbol": "$"}, - "IQ" : { "code": "IQD" ,"symbol": "ع.د"}, - "IR" : { "code": "IRR" ,"symbol": "﷼"}, - "IS" : { "code": "ISK" ,"symbol": "kr"}, - "IT" : { "code": "EUR" ,"symbol": "€"}, - "JE" : { "code": "GBP" ,"symbol": "£"}, - "JM" : { "code": "JMD" ,"symbol": "J$"}, - "JO" : { "code": "JOD" ,"symbol": "JD"}, - "JP" : { "code": "JPY" ,"symbol": "¥"}, - "KE" : { "code": "KES" ,"symbol": "KSh"}, - "KG" : { "code": "KGS" ,"symbol": "лв"}, - "KH" : { "code": "KHR" ,"symbol": "៛"}, - "KI" : { "code": "AUD" ,"symbol": "$"}, - "KM" : { "code": "KMF" ,"symbol": "CF"}, - "KN" : { "code": "XCD" ,"symbol": "$"}, - "KP" : { "code": "KPW" ,"symbol": "₩"}, - "KR" : { "code": "KRW" ,"symbol": "₩"}, - "KW" : { "code": "KWD" ,"symbol": "KD"}, - "KY" : { "code": "KYD" ,"symbol": "$"}, - "KZ" : { "code": "KZT" ,"symbol": "₸"}, - "LA" : { "code": "LAK" ,"symbol": "₭"}, - "LB" : { "code": "LBP" ,"symbol": "£"}, - "LC" : { "code": "XCD" ,"symbol": "$"}, - "LI" : { "code": "CHF" ,"symbol": "CHF"}, - "LK" : { "code": "LKR" ,"symbol": "₨"}, - "LR" : { "code": "LRD" ,"symbol": "$"}, - "LS" : { "code": "LSL" ,"symbol": "M"}, - "LT" : { "code": "LTL" ,"symbol": "Lt"}, - "LU" : { "code": "EUR" ,"symbol": "€"}, - "LV" : { "code": "EUR" ,"symbol": "€"}, - "LY" : { "code": "LYD" ,"symbol": "LD"}, - "MA" : { "code": "MAD" ,"symbol": "MAD"}, - "MC" : { "code": "EUR" ,"symbol": "€"}, - "MD" : { "code": "MDL" ,"symbol": "lei"}, - "ME" : { "code": "EUR" ,"symbol": "€"}, - "MF" : { "code": "EUR" ,"symbol": "€"}, - "MG" : { "code": "MGA" ,"symbol": "Ar"}, - "MH" : { "code": "USD" ,"symbol": "$"}, - "MK" : { "code": "MKD" ,"symbol": "ден"}, - "ML" : { "code": "XOF" ,"symbol": "CFA"}, - "MM" : { "code": "MMK" ,"symbol": "K"}, - "MN" : { "code": "MNT" ,"symbol": "₮"}, - "MO" : { "code": "MOP" ,"symbol": "MOP$"}, - "MP" : { "code": "USD" ,"symbol": "$"}, - "MQ" : { "code": "EUR" ,"symbol": "€"}, - "MR" : { "code": "MRO" ,"symbol": "UM"}, - "MS" : { "code": "XCD" ,"symbol": "$"}, - "MT" : { "code": "EUR" ,"symbol": "€"}, - "MU" : { "code": "MUR" ,"symbol": "₨"}, - "MV" : { "code": "MVR" ,"symbol": "Rf"}, - "MW" : { "code": "MWK" ,"symbol": "MK"}, - "MX" : { "code": "MXN" ,"symbol": "$"}, - "MY" : { "code": "MYR" ,"symbol": "RM"}, - "MZ" : { "code": "MZN" ,"symbol": "MT"}, - "NA" : { "code": "NAD" ,"symbol": "$"}, - "NC" : { "code": "XPF" ,"symbol": "₣"}, - "NE" : { "code": "XOF" ,"symbol": "CFA"}, - "NF" : { "code": "AUD" ,"symbol": "$"}, - "NG" : { "code": "NGN" ,"symbol": "₦"}, - "NI" : { "code": "NIO" ,"symbol": "C$"}, - "NL" : { "code": "EUR" ,"symbol": "€"}, - "NO" : { "code": "NOK" ,"symbol": "kr"}, - "NP" : { "code": "NPR" ,"symbol": "₨"}, - "NR" : { "code": "AUD" ,"symbol": "$"}, - "NU" : { "code": "NZD" ,"symbol": "$"}, - "NZ" : { "code": "NZD" ,"symbol": "$"}, - "OM" : { "code": "OMR" ,"symbol": "﷼"}, - "PA" : { "code": "PAB" ,"symbol": "B/."}, - "PE" : { "code": "PEN" ,"symbol": "S/."}, - "PF" : { "code": "XPF" ,"symbol": "₣"}, - "PG" : { "code": "PGK" ,"symbol": "K"}, - "PH" : { "code": "PHP" ,"symbol": "₱"}, - "PK" : { "code": "PKR" ,"symbol": "₨"}, - "PL" : { "code": "PLN" ,"symbol": "zł"}, - "PM" : { "code": "EUR" ,"symbol": "€"}, - "PN" : { "code": "NZD" ,"symbol": "$"}, - "PR" : { "code": "USD" ,"symbol": "$"}, - "PS" : { "code": "ILS" ,"symbol": "₪"}, - "PT" : { "code": "EUR" ,"symbol": "€"}, - "PW" : { "code": "USD" ,"symbol": "$"}, - "PY" : { "code": "PYG" ,"symbol": "Gs"}, - "QA" : { "code": "QAR" ,"symbol": "﷼"}, - "RE" : { "code": "EUR" ,"symbol": "€"}, - "RO" : { "code": "RON" ,"symbol": "lei"}, - "RS" : { "code": "RSD" ,"symbol": "Дин."}, - "RU" : { "code": "RUB" ,"symbol": "₽"}, - "RW" : { "code": "RWF" ,"symbol": "R₣"}, - "SA" : { "code": "SAR" ,"symbol": "﷼"}, - "SB" : { "code": "SBD" ,"symbol": "$"}, - "SC" : { "code": "SCR" ,"symbol": "₨"}, - "SD" : { "code": "SDG" ,"symbol": "ج.س."}, - "SE" : { "code": "SEK" ,"symbol": "kr"}, - "SG" : { "code": "SGD" ,"symbol": "S$"}, - "SH" : { "code": "SHP" ,"symbol": "£"}, - "SI" : { "code": "EUR" ,"symbol": "€"}, - "SJ" : { "code": "NOK" ,"symbol": "kr"}, - "SK" : { "code": "EUR" ,"symbol": "€"}, - "SL" : { "code": "SLL" ,"symbol": "Le"}, - "SM" : { "code": "EUR" ,"symbol": "€"}, - "SN" : { "code": "XOF" ,"symbol": "CFA"}, - "SO" : { "code": "SOS" ,"symbol": "S"}, - "SR" : { "code": "SRD" ,"symbol": "$"}, - "SS" : { "code": "SSP" ,"symbol": "£"}, - "ST" : { "code": "STD" ,"symbol": "Db"}, - "SV" : { "code": "USD" ,"symbol": "$"}, - "SX" : { "code": "ANG" ,"symbol": "ƒ"}, - "SY" : { "code": "SYP" ,"symbol": "£"}, - "SZ" : { "code": "SZL" ,"symbol": "E"}, - "TC" : { "code": "USD" ,"symbol": "$"}, - "TD" : { "code": "XAF" ,"symbol": "FCFA"}, - "TF" : { "code": "EUR" ,"symbol": "€"}, - "TG" : { "code": "XOF" ,"symbol": "CFA"}, - "TH" : { "code": "THB" ,"symbol": "฿"}, - "TJ" : { "code": "TJS" ,"symbol": "SM"}, - "TK" : { "code": "NZD" ,"symbol": "$"}, - "TL" : { "code": "USD" ,"symbol": "$"}, - "TM" : { "code": "TMT" ,"symbol": "T"}, - "TN" : { "code": "TND" ,"symbol": "د.ت"}, - "TO" : { "code": "TOP" ,"symbol": "T$"}, - "TR" : { "code": "TRY" ,"symbol": "₺"}, - "TT" : { "code": "TTD" ,"symbol": "TT$"}, - "TV" : { "code": "AUD" ,"symbol": "$"}, - "TW" : { "code": "TWD" ,"symbol": "NT$"}, - "TZ" : { "code": "TZS" ,"symbol": "TSh"}, - "UA" : { "code": "UAH" ,"symbol": "₴"}, - "UG" : { "code": "UGX" ,"symbol": "USh"}, - "UM" : { "code": "USD" ,"symbol": "$"}, - "US" : { "code": "USD" ,"symbol": "$"}, - "UY" : { "code": "UYU" ,"symbol": "$U"}, - "UZ" : { "code": "UZS" ,"symbol": "лв"}, - "VA" : { "code": "EUR" ,"symbol": "€"}, - "VC" : { "code": "XCD" ,"symbol": "$"}, - "VE" : { "code": "VEF" ,"symbol": "Bs"}, - "VG" : { "code": "USD" ,"symbol": "$"}, - "VI" : { "code": "USD" ,"symbol": "$"}, - "VN" : { "code": "VND" ,"symbol": "₫"}, - "VU" : { "code": "VUV" ,"symbol": "VT"}, - "WF" : { "code": "XPF" ,"symbol": "₣"}, - "WS" : { "code": "WST" ,"symbol": "WS$"}, - "XK" : { "code": "EUR" ,"symbol": "€"}, - "YE" : { "code": "YER" ,"symbol": "﷼"}, - "YT" : { "code": "EUR" ,"symbol": "€"}, - "ZA" : { "code": "ZAR" ,"symbol": "R"}, - "ZM" : { "code": "ZMK" ,"symbol": "ZK"}, - "ZW" : { "code": "ZWL" ,"symbol": "$"} -} diff --git a/ipinfo/currency.py b/ipinfo/currency.py new file mode 100644 index 0000000..f910462 --- /dev/null +++ b/ipinfo/currency.py @@ -0,0 +1,252 @@ +countries_currencies = { + "AD": {"code": "EUR", "symbol": "€"}, + "AE": {"code": "AED", "symbol": "د.إ"}, + "AF": {"code": "AFN", "symbol": "؋"}, + "AG": {"code": "XCD", "symbol": "$"}, + "AI": {"code": "XCD", "symbol": "$"}, + "AL": {"code": "ALL", "symbol": "L"}, + "AM": {"code": "AMD", "symbol": "֏"}, + "AO": {"code": "AOA", "symbol": "Kz"}, + "AQ": {"code": "", "symbol": "$"}, + "AR": {"code": "ARS", "symbol": "$"}, + "AS": {"code": "USD", "symbol": "$"}, + "AT": {"code": "EUR", "symbol": "€"}, + "AU": {"code": "AUD", "symbol": "$"}, + "AW": {"code": "AWG", "symbol": "ƒ"}, + "AX": {"code": "EUR", "symbol": "€"}, + "AZ": {"code": "AZN", "symbol": "₼"}, + "BA": {"code": "BAM", "symbol": "KM"}, + "BB": {"code": "BBD", "symbol": "$"}, + "BD": {"code": "BDT", "symbol": "৳"}, + "BE": {"code": "EUR", "symbol": "€"}, + "BF": {"code": "XOF", "symbol": "CFA"}, + "BG": {"code": "BGN", "symbol": "лв"}, + "BH": {"code": "BHD", "symbol": ".د.ب"}, + "BI": {"code": "BIF", "symbol": "FBu"}, + "BJ": {"code": "XOF", "symbol": "CFA"}, + "BL": {"code": "EUR", "symbol": "€"}, + "BM": {"code": "BMD", "symbol": "$"}, + "BN": {"code": "BND", "symbol": "$"}, + "BO": {"code": "BOB", "symbol": "$b"}, + "BQ": {"code": "USD", "symbol": "$"}, + "BR": {"code": "BRL", "symbol": "R$"}, + "BS": {"code": "BSD", "symbol": "$"}, + "BT": {"code": "BTN", "symbol": "Nu."}, + "BV": {"code": "NOK", "symbol": "kr"}, + "BW": {"code": "BWP", "symbol": "P"}, + "BY": {"code": "BYR", "symbol": "Br"}, + "BZ": {"code": "BZD", "symbol": "BZ$"}, + "CA": {"code": "CAD", "symbol": "$"}, + "CC": {"code": "AUD", "symbol": "$"}, + "CD": {"code": "CDF", "symbol": "FC"}, + "CF": {"code": "XAF", "symbol": "FCFA"}, + "CG": {"code": "XAF", "symbol": "FCFA"}, + "CH": {"code": "CHF", "symbol": "CHF"}, + "CI": {"code": "XOF", "symbol": "CFA"}, + "CK": {"code": "NZD", "symbol": "$"}, + "CL": {"code": "CLP", "symbol": "$"}, + "CM": {"code": "XAF", "symbol": "FCFA"}, + "CN": {"code": "CNY", "symbol": "¥"}, + "CO": {"code": "COP", "symbol": "$"}, + "CR": {"code": "CRC", "symbol": "₡"}, + "CU": {"code": "CUP", "symbol": "₱"}, + "CV": {"code": "CVE", "symbol": "$"}, + "CW": {"code": "ANG", "symbol": "ƒ"}, + "CX": {"code": "AUD", "symbol": "$"}, + "CY": {"code": "EUR", "symbol": "€"}, + "CZ": {"code": "CZK", "symbol": "Kč"}, + "DE": {"code": "EUR", "symbol": "€"}, + "DJ": {"code": "DJF", "symbol": "Fdj"}, + "DK": {"code": "DKK", "symbol": "kr"}, + "DM": {"code": "XCD", "symbol": "$"}, + "DO": {"code": "DOP", "symbol": "RD$"}, + "DZ": {"code": "DZD", "symbol": "دج"}, + "EC": {"code": "USD", "symbol": "$"}, + "EE": {"code": "EUR", "symbol": "€"}, + "EG": {"code": "EGP", "symbol": "£"}, + "EH": {"code": "MAD", "symbol": "MAD"}, + "ER": {"code": "ERN", "symbol": "Nfk"}, + "ES": {"code": "EUR", "symbol": "€"}, + "ET": {"code": "ETB", "symbol": "Br"}, + "FI": {"code": "EUR", "symbol": "€"}, + "FJ": {"code": "FJD", "symbol": "$"}, + "FK": {"code": "FKP", "symbol": "£"}, + "FM": {"code": "USD", "symbol": "$"}, + "FO": {"code": "DKK", "symbol": "kr"}, + "FR": {"code": "EUR", "symbol": "€"}, + "GA": {"code": "XAF", "symbol": "FCFA"}, + "GB": {"code": "GBP", "symbol": "£"}, + "GD": {"code": "XCD", "symbol": "$"}, + "GE": {"code": "GEL", "symbol": "ლ"}, + "GF": {"code": "EUR", "symbol": "€"}, + "GG": {"code": "GBP", "symbol": "£"}, + "GH": {"code": "GHS", "symbol": "GH₵"}, + "GI": {"code": "GIP", "symbol": "£"}, + "GL": {"code": "DKK", "symbol": "kr"}, + "GM": {"code": "GMD", "symbol": "D"}, + "GN": {"code": "GNF", "symbol": "FG"}, + "GP": {"code": "EUR", "symbol": "€"}, + "GQ": {"code": "XAF", "symbol": "FCFA"}, + "GR": {"code": "EUR", "symbol": "€"}, + "GS": {"code": "GBP", "symbol": "£"}, + "GT": {"code": "GTQ", "symbol": "Q"}, + "GU": {"code": "USD", "symbol": "$"}, + "GW": {"code": "XOF", "symbol": "CFA"}, + "GY": {"code": "GYD", "symbol": "$"}, + "HK": {"code": "HKD", "symbol": "$"}, + "HM": {"code": "AUD", "symbol": "$"}, + "HN": {"code": "HNL", "symbol": "L"}, + "HR": {"code": "HRK", "symbol": "kn"}, + "HT": {"code": "HTG", "symbol": "G"}, + "HU": {"code": "HUF", "symbol": "Ft"}, + "ID": {"code": "IDR", "symbol": "Rp"}, + "IE": {"code": "EUR", "symbol": "€"}, + "IL": {"code": "ILS", "symbol": "₪"}, + "IM": {"code": "GBP", "symbol": "£"}, + "IN": {"code": "INR", "symbol": "₹"}, + "IO": {"code": "USD", "symbol": "$"}, + "IQ": {"code": "IQD", "symbol": "ع.د"}, + "IR": {"code": "IRR", "symbol": "﷼"}, + "IS": {"code": "ISK", "symbol": "kr"}, + "IT": {"code": "EUR", "symbol": "€"}, + "JE": {"code": "GBP", "symbol": "£"}, + "JM": {"code": "JMD", "symbol": "J$"}, + "JO": {"code": "JOD", "symbol": "JD"}, + "JP": {"code": "JPY", "symbol": "¥"}, + "KE": {"code": "KES", "symbol": "KSh"}, + "KG": {"code": "KGS", "symbol": "лв"}, + "KH": {"code": "KHR", "symbol": "៛"}, + "KI": {"code": "AUD", "symbol": "$"}, + "KM": {"code": "KMF", "symbol": "CF"}, + "KN": {"code": "XCD", "symbol": "$"}, + "KP": {"code": "KPW", "symbol": "₩"}, + "KR": {"code": "KRW", "symbol": "₩"}, + "KW": {"code": "KWD", "symbol": "KD"}, + "KY": {"code": "KYD", "symbol": "$"}, + "KZ": {"code": "KZT", "symbol": "₸"}, + "LA": {"code": "LAK", "symbol": "₭"}, + "LB": {"code": "LBP", "symbol": "£"}, + "LC": {"code": "XCD", "symbol": "$"}, + "LI": {"code": "CHF", "symbol": "CHF"}, + "LK": {"code": "LKR", "symbol": "₨"}, + "LR": {"code": "LRD", "symbol": "$"}, + "LS": {"code": "LSL", "symbol": "M"}, + "LT": {"code": "LTL", "symbol": "Lt"}, + "LU": {"code": "EUR", "symbol": "€"}, + "LV": {"code": "EUR", "symbol": "€"}, + "LY": {"code": "LYD", "symbol": "LD"}, + "MA": {"code": "MAD", "symbol": "MAD"}, + "MC": {"code": "EUR", "symbol": "€"}, + "MD": {"code": "MDL", "symbol": "lei"}, + "ME": {"code": "EUR", "symbol": "€"}, + "MF": {"code": "EUR", "symbol": "€"}, + "MG": {"code": "MGA", "symbol": "Ar"}, + "MH": {"code": "USD", "symbol": "$"}, + "MK": {"code": "MKD", "symbol": "ден"}, + "ML": {"code": "XOF", "symbol": "CFA"}, + "MM": {"code": "MMK", "symbol": "K"}, + "MN": {"code": "MNT", "symbol": "₮"}, + "MO": {"code": "MOP", "symbol": "MOP$"}, + "MP": {"code": "USD", "symbol": "$"}, + "MQ": {"code": "EUR", "symbol": "€"}, + "MR": {"code": "MRO", "symbol": "UM"}, + "MS": {"code": "XCD", "symbol": "$"}, + "MT": {"code": "EUR", "symbol": "€"}, + "MU": {"code": "MUR", "symbol": "₨"}, + "MV": {"code": "MVR", "symbol": "Rf"}, + "MW": {"code": "MWK", "symbol": "MK"}, + "MX": {"code": "MXN", "symbol": "$"}, + "MY": {"code": "MYR", "symbol": "RM"}, + "MZ": {"code": "MZN", "symbol": "MT"}, + "NA": {"code": "NAD", "symbol": "$"}, + "NC": {"code": "XPF", "symbol": "₣"}, + "NE": {"code": "XOF", "symbol": "CFA"}, + "NF": {"code": "AUD", "symbol": "$"}, + "NG": {"code": "NGN", "symbol": "₦"}, + "NI": {"code": "NIO", "symbol": "C$"}, + "NL": {"code": "EUR", "symbol": "€"}, + "NO": {"code": "NOK", "symbol": "kr"}, + "NP": {"code": "NPR", "symbol": "₨"}, + "NR": {"code": "AUD", "symbol": "$"}, + "NU": {"code": "NZD", "symbol": "$"}, + "NZ": {"code": "NZD", "symbol": "$"}, + "OM": {"code": "OMR", "symbol": "﷼"}, + "PA": {"code": "PAB", "symbol": "B/."}, + "PE": {"code": "PEN", "symbol": "S/."}, + "PF": {"code": "XPF", "symbol": "₣"}, + "PG": {"code": "PGK", "symbol": "K"}, + "PH": {"code": "PHP", "symbol": "₱"}, + "PK": {"code": "PKR", "symbol": "₨"}, + "PL": {"code": "PLN", "symbol": "zł"}, + "PM": {"code": "EUR", "symbol": "€"}, + "PN": {"code": "NZD", "symbol": "$"}, + "PR": {"code": "USD", "symbol": "$"}, + "PS": {"code": "ILS", "symbol": "₪"}, + "PT": {"code": "EUR", "symbol": "€"}, + "PW": {"code": "USD", "symbol": "$"}, + "PY": {"code": "PYG", "symbol": "Gs"}, + "QA": {"code": "QAR", "symbol": "﷼"}, + "RE": {"code": "EUR", "symbol": "€"}, + "RO": {"code": "RON", "symbol": "lei"}, + "RS": {"code": "RSD", "symbol": "Дин."}, + "RU": {"code": "RUB", "symbol": "₽"}, + "RW": {"code": "RWF", "symbol": "R₣"}, + "SA": {"code": "SAR", "symbol": "﷼"}, + "SB": {"code": "SBD", "symbol": "$"}, + "SC": {"code": "SCR", "symbol": "₨"}, + "SD": {"code": "SDG", "symbol": "ج.س."}, + "SE": {"code": "SEK", "symbol": "kr"}, + "SG": {"code": "SGD", "symbol": "S$"}, + "SH": {"code": "SHP", "symbol": "£"}, + "SI": {"code": "EUR", "symbol": "€"}, + "SJ": {"code": "NOK", "symbol": "kr"}, + "SK": {"code": "EUR", "symbol": "€"}, + "SL": {"code": "SLL", "symbol": "Le"}, + "SM": {"code": "EUR", "symbol": "€"}, + "SN": {"code": "XOF", "symbol": "CFA"}, + "SO": {"code": "SOS", "symbol": "S"}, + "SR": {"code": "SRD", "symbol": "$"}, + "SS": {"code": "SSP", "symbol": "£"}, + "ST": {"code": "STD", "symbol": "Db"}, + "SV": {"code": "USD", "symbol": "$"}, + "SX": {"code": "ANG", "symbol": "ƒ"}, + "SY": {"code": "SYP", "symbol": "£"}, + "SZ": {"code": "SZL", "symbol": "E"}, + "TC": {"code": "USD", "symbol": "$"}, + "TD": {"code": "XAF", "symbol": "FCFA"}, + "TF": {"code": "EUR", "symbol": "€"}, + "TG": {"code": "XOF", "symbol": "CFA"}, + "TH": {"code": "THB", "symbol": "฿"}, + "TJ": {"code": "TJS", "symbol": "SM"}, + "TK": {"code": "NZD", "symbol": "$"}, + "TL": {"code": "USD", "symbol": "$"}, + "TM": {"code": "TMT", "symbol": "T"}, + "TN": {"code": "TND", "symbol": "د.ت"}, + "TO": {"code": "TOP", "symbol": "T$"}, + "TR": {"code": "TRY", "symbol": "₺"}, + "TT": {"code": "TTD", "symbol": "TT$"}, + "TV": {"code": "AUD", "symbol": "$"}, + "TW": {"code": "TWD", "symbol": "NT$"}, + "TZ": {"code": "TZS", "symbol": "TSh"}, + "UA": {"code": "UAH", "symbol": "₴"}, + "UG": {"code": "UGX", "symbol": "USh"}, + "UM": {"code": "USD", "symbol": "$"}, + "US": {"code": "USD", "symbol": "$"}, + "UY": {"code": "UYU", "symbol": "$U"}, + "UZ": {"code": "UZS", "symbol": "лв"}, + "VA": {"code": "EUR", "symbol": "€"}, + "VC": {"code": "XCD", "symbol": "$"}, + "VE": {"code": "VEF", "symbol": "Bs"}, + "VG": {"code": "USD", "symbol": "$"}, + "VI": {"code": "USD", "symbol": "$"}, + "VN": {"code": "VND", "symbol": "₫"}, + "VU": {"code": "VUV", "symbol": "VT"}, + "WF": {"code": "XPF", "symbol": "₣"}, + "WS": {"code": "WST", "symbol": "WS$"}, + "XK": {"code": "EUR", "symbol": "€"}, + "YE": {"code": "YER", "symbol": "﷼"}, + "YT": {"code": "EUR", "symbol": "€"}, + "ZA": {"code": "ZAR", "symbol": "R"}, + "ZM": {"code": "ZMK", "symbol": "ZK"}, + "ZW": {"code": "ZWL", "symbol": "$"} +} diff --git a/ipinfo/eu.json b/ipinfo/eu.json deleted file mode 100644 index a8872d5..0000000 --- a/ipinfo/eu.json +++ /dev/null @@ -1 +0,0 @@ -["IE","AT","LT","LU","LV","DE","DK","SE","SI","SK","CZ","CY","NL","FI","FR","MT","ES","IT","EE","PL","PT","HU","HR","GR","RO","BG","BE"] diff --git a/ipinfo/eu.py b/ipinfo/eu.py new file mode 100644 index 0000000..5179ed4 --- /dev/null +++ b/ipinfo/eu.py @@ -0,0 +1,2 @@ +eu_countries = ["IE", "AT", "LT", "LU", "LV", "DE", "DK", "SE", "SI", "SK", "CZ", "CY", "NL", "FI", "FR", "MT", "ES", + "IT", "EE", "PL", "PT", "HU", "HR", "GR", "RO", "BG", "BE"] diff --git a/ipinfo/flags.json b/ipinfo/flags.json deleted file mode 100644 index 3ec4619..0000000 --- a/ipinfo/flags.json +++ /dev/null @@ -1,252 +0,0 @@ -{ - "AD": {"emoji": "🇦🇩","unicode": "U+1F1E6 U+1F1E9"}, - "AE": {"emoji": "🇦🇪","unicode": "U+1F1E6 U+1F1EA"}, - "AF": {"emoji": "🇦🇫","unicode": "U+1F1E6 U+1F1EB"}, - "AG": {"emoji": "🇦🇬","unicode": "U+1F1E6 U+1F1EC"}, - "AI": {"emoji": "🇦🇮","unicode": "U+1F1E6 U+1F1EE"}, - "AL": {"emoji": "🇦🇱","unicode": "U+1F1E6 U+1F1F1"}, - "AM": {"emoji": "🇦🇲","unicode": "U+1F1E6 U+1F1F2"}, - "AO": {"emoji": "🇦🇴","unicode": "U+1F1E6 U+1F1F4"}, - "AQ": {"emoji": "🇦🇶","unicode": "U+1F1E6 U+1F1F6"}, - "AR": {"emoji": "🇦🇷","unicode": "U+1F1E6 U+1F1F7"}, - "AS": {"emoji": "🇦🇸","unicode": "U+1F1E6 U+1F1F8"}, - "AT": {"emoji": "🇦🇹","unicode": "U+1F1E6 U+1F1F9"}, - "AU": {"emoji": "🇦🇺","unicode": "U+1F1E6 U+1F1FA"}, - "AW": {"emoji": "🇦🇼","unicode": "U+1F1E6 U+1F1FC"}, - "AX": {"emoji": "🇦🇽","unicode": "U+1F1E6 U+1F1FD"}, - "AZ": {"emoji": "🇦🇿","unicode": "U+1F1E6 U+1F1FF"}, - "BA": {"emoji": "🇧🇦","unicode": "U+1F1E7 U+1F1E6"}, - "BB": {"emoji": "🇧🇧","unicode": "U+1F1E7 U+1F1E7"}, - "BD": {"emoji": "🇧🇩","unicode": "U+1F1E7 U+1F1E9"}, - "BE": {"emoji": "🇧🇪","unicode": "U+1F1E7 U+1F1EA"}, - "BF": {"emoji": "🇧🇫","unicode": "U+1F1E7 U+1F1EB"}, - "BG": {"emoji": "🇧🇬","unicode": "U+1F1E7 U+1F1EC"}, - "BH": {"emoji": "🇧🇭","unicode": "U+1F1E7 U+1F1ED"}, - "BI": {"emoji": "🇧🇮","unicode": "U+1F1E7 U+1F1EE"}, - "BJ": {"emoji": "🇧🇯","unicode": "U+1F1E7 U+1F1EF"}, - "BL": {"emoji": "🇧🇱","unicode": "U+1F1E7 U+1F1F1"}, - "BM": {"emoji": "🇧🇲","unicode": "U+1F1E7 U+1F1F2"}, - "BN": {"emoji": "🇧🇳","unicode": "U+1F1E7 U+1F1F3"}, - "BO": {"emoji": "🇧🇴","unicode": "U+1F1E7 U+1F1F4"}, - "BQ": {"emoji": "🇧🇶","unicode": "U+1F1E7 U+1F1F6"}, - "BR": {"emoji": "🇧🇷","unicode": "U+1F1E7 U+1F1F7"}, - "BS": {"emoji": "🇧🇸","unicode": "U+1F1E7 U+1F1F8"}, - "BT": {"emoji": "🇧🇹","unicode": "U+1F1E7 U+1F1F9"}, - "BV": {"emoji": "🇧🇻","unicode": "U+1F1E7 U+1F1FB"}, - "BW": {"emoji": "🇧🇼","unicode": "U+1F1E7 U+1F1FC"}, - "BY": {"emoji": "🇧🇾","unicode": "U+1F1E7 U+1F1FE"}, - "BZ": {"emoji": "🇧🇿","unicode": "U+1F1E7 U+1F1FF"}, - "CA": {"emoji": "🇨🇦","unicode": "U+1F1E8 U+1F1E6"}, - "CC": {"emoji": "🇨🇨","unicode": "U+1F1E8 U+1F1E8"}, - "CD": {"emoji": "🇨🇩","unicode": "U+1F1E8 U+1F1E9"}, - "CF": {"emoji": "🇨🇫","unicode": "U+1F1E8 U+1F1EB"}, - "CG": {"emoji": "🇨🇬","unicode": "U+1F1E8 U+1F1EC"}, - "CH": {"emoji": "🇨🇭","unicode": "U+1F1E8 U+1F1ED"}, - "CI": {"emoji": "🇨🇮","unicode": "U+1F1E8 U+1F1EE"}, - "CK": {"emoji": "🇨🇰","unicode": "U+1F1E8 U+1F1F0"}, - "CL": {"emoji": "🇨🇱","unicode": "U+1F1E8 U+1F1F1"}, - "CM": {"emoji": "🇨🇲","unicode": "U+1F1E8 U+1F1F2"}, - "CN": {"emoji": "🇨🇳","unicode": "U+1F1E8 U+1F1F3"}, - "CO": {"emoji": "🇨🇴","unicode": "U+1F1E8 U+1F1F4"}, - "CR": {"emoji": "🇨🇷","unicode": "U+1F1E8 U+1F1F7"}, - "CU": {"emoji": "🇨🇺","unicode": "U+1F1E8 U+1F1FA"}, - "CV": {"emoji": "🇨🇻","unicode": "U+1F1E8 U+1F1FB"}, - "CW": {"emoji": "🇨🇼","unicode": "U+1F1E8 U+1F1FC"}, - "CX": {"emoji": "🇨🇽","unicode": "U+1F1E8 U+1F1FD"}, - "CY": {"emoji": "🇨🇾","unicode": "U+1F1E8 U+1F1FE"}, - "CZ": {"emoji": "🇨🇿","unicode": "U+1F1E8 U+1F1FF"}, - "DE": {"emoji": "🇩🇪","unicode": "U+1F1E9 U+1F1EA"}, - "DJ": {"emoji": "🇩🇯","unicode": "U+1F1E9 U+1F1EF"}, - "DK": {"emoji": "🇩🇰","unicode": "U+1F1E9 U+1F1F0"}, - "DM": {"emoji": "🇩🇲","unicode": "U+1F1E9 U+1F1F2"}, - "DO": {"emoji": "🇩🇴","unicode": "U+1F1E9 U+1F1F4"}, - "DZ": {"emoji": "🇩🇿","unicode": "U+1F1E9 U+1F1FF"}, - "EC": {"emoji": "🇪🇨","unicode": "U+1F1EA U+1F1E8"}, - "EE": {"emoji": "🇪🇪","unicode": "U+1F1EA U+1F1EA"}, - "EG": {"emoji": "🇪🇬","unicode": "U+1F1EA U+1F1EC"}, - "EH": {"emoji": "🇪🇭","unicode": "U+1F1EA U+1F1ED"}, - "ER": {"emoji": "🇪🇷","unicode": "U+1F1EA U+1F1F7"}, - "ES": {"emoji": "🇪🇸","unicode": "U+1F1EA U+1F1F8"}, - "ET": {"emoji": "🇪🇹","unicode": "U+1F1EA U+1F1F9"}, - "FI": {"emoji": "🇫🇮","unicode": "U+1F1EB U+1F1EE"}, - "FJ": {"emoji": "🇫🇯","unicode": "U+1F1EB U+1F1EF"}, - "FK": {"emoji": "🇫🇰","unicode": "U+1F1EB U+1F1F0"}, - "FM": {"emoji": "🇫🇲","unicode": "U+1F1EB U+1F1F2"}, - "FO": {"emoji": "🇫🇴","unicode": "U+1F1EB U+1F1F4"}, - "FR": {"emoji": "🇫🇷","unicode": "U+1F1EB U+1F1F7"}, - "GA": {"emoji": "🇬🇦","unicode": "U+1F1EC U+1F1E6"}, - "GB": {"emoji": "🇬🇧","unicode": "U+1F1EC U+1F1E7"}, - "GD": {"emoji": "🇬🇩","unicode": "U+1F1EC U+1F1E9"}, - "GE": {"emoji": "🇬🇪","unicode": "U+1F1EC U+1F1EA"}, - "GF": {"emoji": "🇬🇫","unicode": "U+1F1EC U+1F1EB"}, - "GG": {"emoji": "🇬🇬","unicode": "U+1F1EC U+1F1EC"}, - "GH": {"emoji": "🇬🇭","unicode": "U+1F1EC U+1F1ED"}, - "GI": {"emoji": "🇬🇮","unicode": "U+1F1EC U+1F1EE"}, - "GL": {"emoji": "🇬🇱","unicode": "U+1F1EC U+1F1F1"}, - "GM": {"emoji": "🇬🇲","unicode": "U+1F1EC U+1F1F2"}, - "GN": {"emoji": "🇬🇳","unicode": "U+1F1EC U+1F1F3"}, - "GP": {"emoji": "🇬🇵","unicode": "U+1F1EC U+1F1F5"}, - "GQ": {"emoji": "🇬🇶","unicode": "U+1F1EC U+1F1F6"}, - "GR": {"emoji": "🇬🇷","unicode": "U+1F1EC U+1F1F7"}, - "GS": {"emoji": "🇬🇸","unicode": "U+1F1EC U+1F1F8"}, - "GT": {"emoji": "🇬🇹","unicode": "U+1F1EC U+1F1F9"}, - "GU": {"emoji": "🇬🇺","unicode": "U+1F1EC U+1F1FA"}, - "GW": {"emoji": "🇬🇼","unicode": "U+1F1EC U+1F1FC"}, - "GY": {"emoji": "🇬🇾","unicode": "U+1F1EC U+1F1FE"}, - "HK": {"emoji": "🇭🇰","unicode": "U+1F1ED U+1F1F0"}, - "HM": {"emoji": "🇭🇲","unicode": "U+1F1ED U+1F1F2"}, - "HN": {"emoji": "🇭🇳","unicode": "U+1F1ED U+1F1F3"}, - "HR": {"emoji": "🇭🇷","unicode": "U+1F1ED U+1F1F7"}, - "HT": {"emoji": "🇭🇹","unicode": "U+1F1ED U+1F1F9"}, - "HU": {"emoji": "🇭🇺","unicode": "U+1F1ED U+1F1FA"}, - "ID": {"emoji": "🇮🇩","unicode": "U+1F1EE U+1F1E9"}, - "IE": {"emoji": "🇮🇪","unicode": "U+1F1EE U+1F1EA"}, - "IL": {"emoji": "🇮🇱","unicode": "U+1F1EE U+1F1F1"}, - "IM": {"emoji": "🇮🇲","unicode": "U+1F1EE U+1F1F2"}, - "IN": {"emoji": "🇮🇳","unicode": "U+1F1EE U+1F1F3"}, - "IO": {"emoji": "🇮🇴","unicode": "U+1F1EE U+1F1F4"}, - "IQ": {"emoji": "🇮🇶","unicode": "U+1F1EE U+1F1F6"}, - "IR": {"emoji": "🇮🇷","unicode": "U+1F1EE U+1F1F7"}, - "IS": {"emoji": "🇮🇸","unicode": "U+1F1EE U+1F1F8"}, - "IT": {"emoji": "🇮🇹","unicode": "U+1F1EE U+1F1F9"}, - "JE": {"emoji": "🇯🇪","unicode": "U+1F1EF U+1F1EA"}, - "JM": {"emoji": "🇯🇲","unicode": "U+1F1EF U+1F1F2"}, - "JO": {"emoji": "🇯🇴","unicode": "U+1F1EF U+1F1F4"}, - "JP": {"emoji": "🇯🇵","unicode": "U+1F1EF U+1F1F5"}, - "KE": {"emoji": "🇰🇪","unicode": "U+1F1F0 U+1F1EA"}, - "KG": {"emoji": "🇰🇬","unicode": "U+1F1F0 U+1F1EC"}, - "KH": {"emoji": "🇰🇭","unicode": "U+1F1F0 U+1F1ED"}, - "KI": {"emoji": "🇰🇮","unicode": "U+1F1F0 U+1F1EE"}, - "KM": {"emoji": "🇰🇲","unicode": "U+1F1F0 U+1F1F2"}, - "KN": {"emoji": "🇰🇳","unicode": "U+1F1F0 U+1F1F3"}, - "KP": {"emoji": "🇰🇵","unicode": "U+1F1F0 U+1F1F5"}, - "KR": {"emoji": "🇰🇷","unicode": "U+1F1F0 U+1F1F7"}, - "KW": {"emoji": "🇰🇼","unicode": "U+1F1F0 U+1F1FC"}, - "KY": {"emoji": "🇰🇾","unicode": "U+1F1F0 U+1F1FE"}, - "KZ": {"emoji": "🇰🇿","unicode": "U+1F1F0 U+1F1FF"}, - "LA": {"emoji": "🇱🇦","unicode": "U+1F1F1 U+1F1E6"}, - "LB": {"emoji": "🇱🇧","unicode": "U+1F1F1 U+1F1E7"}, - "LC": {"emoji": "🇱🇨","unicode": "U+1F1F1 U+1F1E8"}, - "LI": {"emoji": "🇱🇮","unicode": "U+1F1F1 U+1F1EE"}, - "LK": {"emoji": "🇱🇰","unicode": "U+1F1F1 U+1F1F0"}, - "LR": {"emoji": "🇱🇷","unicode": "U+1F1F1 U+1F1F7"}, - "LS": {"emoji": "🇱🇸","unicode": "U+1F1F1 U+1F1F8"}, - "LT": {"emoji": "🇱🇹","unicode": "U+1F1F1 U+1F1F9"}, - "LU": {"emoji": "🇱🇺","unicode": "U+1F1F1 U+1F1FA"}, - "LV": {"emoji": "🇱🇻","unicode": "U+1F1F1 U+1F1FB"}, - "LY": {"emoji": "🇱🇾","unicode": "U+1F1F1 U+1F1FE"}, - "MA": {"emoji": "🇲🇦","unicode": "U+1F1F2 U+1F1E6"}, - "MC": {"emoji": "🇲🇨","unicode": "U+1F1F2 U+1F1E8"}, - "MD": {"emoji": "🇲🇩","unicode": "U+1F1F2 U+1F1E9"}, - "ME": {"emoji": "🇲🇪","unicode": "U+1F1F2 U+1F1EA"}, - "MF": {"emoji": "🇲🇫","unicode": "U+1F1F2 U+1F1EB"}, - "MG": {"emoji": "🇲🇬","unicode": "U+1F1F2 U+1F1EC"}, - "MH": {"emoji": "🇲🇭","unicode": "U+1F1F2 U+1F1ED"}, - "MK": {"emoji": "🇲🇰","unicode": "U+1F1F2 U+1F1F0"}, - "ML": {"emoji": "🇲🇱","unicode": "U+1F1F2 U+1F1F1"}, - "MM": {"emoji": "🇲🇲","unicode": "U+1F1F2 U+1F1F2"}, - "MN": {"emoji": "🇲🇳","unicode": "U+1F1F2 U+1F1F3"}, - "MO": {"emoji": "🇲🇴","unicode": "U+1F1F2 U+1F1F4"}, - "MP": {"emoji": "🇲🇵","unicode": "U+1F1F2 U+1F1F5"}, - "MQ": {"emoji": "🇲🇶","unicode": "U+1F1F2 U+1F1F6"}, - "MR": {"emoji": "🇲🇷","unicode": "U+1F1F2 U+1F1F7"}, - "MS": {"emoji": "🇲🇸","unicode": "U+1F1F2 U+1F1F8"}, - "MT": {"emoji": "🇲🇹","unicode": "U+1F1F2 U+1F1F9"}, - "MU": {"emoji": "🇲🇺","unicode": "U+1F1F2 U+1F1FA"}, - "MV": {"emoji": "🇲🇻","unicode": "U+1F1F2 U+1F1FB"}, - "MW": {"emoji": "🇲🇼","unicode": "U+1F1F2 U+1F1FC"}, - "MX": {"emoji": "🇲🇽","unicode": "U+1F1F2 U+1F1FD"}, - "MY": {"emoji": "🇲🇾","unicode": "U+1F1F2 U+1F1FE"}, - "MZ": {"emoji": "🇲🇿","unicode": "U+1F1F2 U+1F1FF"}, - "NA": {"emoji": "🇳🇦","unicode": "U+1F1F3 U+1F1E6"}, - "NC": {"emoji": "🇳🇨","unicode": "U+1F1F3 U+1F1E8"}, - "NE": {"emoji": "🇳🇪","unicode": "U+1F1F3 U+1F1EA"}, - "NF": {"emoji": "🇳🇫","unicode": "U+1F1F3 U+1F1EB"}, - "NG": {"emoji": "🇳🇬","unicode": "U+1F1F3 U+1F1EC"}, - "NI": {"emoji": "🇳🇮","unicode": "U+1F1F3 U+1F1EE"}, - "NL": {"emoji": "🇳🇱","unicode": "U+1F1F3 U+1F1F1"}, - "NO": {"emoji": "🇳🇴","unicode": "U+1F1F3 U+1F1F4"}, - "NP": {"emoji": "🇳🇵","unicode": "U+1F1F3 U+1F1F5"}, - "NR": {"emoji": "🇳🇷","unicode": "U+1F1F3 U+1F1F7"}, - "NU": {"emoji": "🇳🇺","unicode": "U+1F1F3 U+1F1FA"}, - "NZ": {"emoji": "🇳🇿","unicode": "U+1F1F3 U+1F1FF"}, - "OM": {"emoji": "🇴🇲","unicode": "U+1F1F4 U+1F1F2"}, - "PA": {"emoji": "🇵🇦","unicode": "U+1F1F5 U+1F1E6"}, - "PE": {"emoji": "🇵🇪","unicode": "U+1F1F5 U+1F1EA"}, - "PF": {"emoji": "🇵🇫","unicode": "U+1F1F5 U+1F1EB"}, - "PG": {"emoji": "🇵🇬","unicode": "U+1F1F5 U+1F1EC"}, - "PH": {"emoji": "🇵🇭","unicode": "U+1F1F5 U+1F1ED"}, - "PK": {"emoji": "🇵🇰","unicode": "U+1F1F5 U+1F1F0"}, - "PL": {"emoji": "🇵🇱","unicode": "U+1F1F5 U+1F1F1"}, - "PM": {"emoji": "🇵🇲","unicode": "U+1F1F5 U+1F1F2"}, - "PN": {"emoji": "🇵🇳","unicode": "U+1F1F5 U+1F1F3"}, - "PR": {"emoji": "🇵🇷","unicode": "U+1F1F5 U+1F1F7"}, - "PS": {"emoji": "🇵🇸","unicode": "U+1F1F5 U+1F1F8"}, - "PT": {"emoji": "🇵🇹","unicode": "U+1F1F5 U+1F1F9"}, - "PW": {"emoji": "🇵🇼","unicode": "U+1F1F5 U+1F1FC"}, - "PY": {"emoji": "🇵🇾","unicode": "U+1F1F5 U+1F1FE"}, - "QA": {"emoji": "🇶🇦","unicode": "U+1F1F6 U+1F1E6"}, - "RE": {"emoji": "🇷🇪","unicode": "U+1F1F7 U+1F1EA"}, - "RO": {"emoji": "🇷🇴","unicode": "U+1F1F7 U+1F1F4"}, - "RS": {"emoji": "🇷🇸","unicode": "U+1F1F7 U+1F1F8"}, - "RU": {"emoji": "🇷🇺","unicode": "U+1F1F7 U+1F1FA"}, - "RW": {"emoji": "🇷🇼","unicode": "U+1F1F7 U+1F1FC"}, - "SA": {"emoji": "🇸🇦","unicode": "U+1F1F8 U+1F1E6"}, - "SB": {"emoji": "🇸🇧","unicode": "U+1F1F8 U+1F1E7"}, - "SC": {"emoji": "🇸🇨","unicode": "U+1F1F8 U+1F1E8"}, - "SD": {"emoji": "🇸🇩","unicode": "U+1F1F8 U+1F1E9"}, - "SE": {"emoji": "🇸🇪","unicode": "U+1F1F8 U+1F1EA"}, - "SG": {"emoji": "🇸🇬","unicode": "U+1F1F8 U+1F1EC"}, - "SH": {"emoji": "🇸🇭","unicode": "U+1F1F8 U+1F1ED"}, - "SI": {"emoji": "🇸🇮","unicode": "U+1F1F8 U+1F1EE"}, - "SJ": {"emoji": "🇸🇯","unicode": "U+1F1F8 U+1F1EF"}, - "SK": {"emoji": "🇸🇰","unicode": "U+1F1F8 U+1F1F0"}, - "SL": {"emoji": "🇸🇱","unicode": "U+1F1F8 U+1F1F1"}, - "SM": {"emoji": "🇸🇲","unicode": "U+1F1F8 U+1F1F2"}, - "SN": {"emoji": "🇸🇳","unicode": "U+1F1F8 U+1F1F3"}, - "SO": {"emoji": "🇸🇴","unicode": "U+1F1F8 U+1F1F4"}, - "SR": {"emoji": "🇸🇷","unicode": "U+1F1F8 U+1F1F7"}, - "SS": {"emoji": "🇸🇸","unicode": "U+1F1F8 U+1F1F8"}, - "ST": {"emoji": "🇸🇹","unicode": "U+1F1F8 U+1F1F9"}, - "SV": {"emoji": "🇸🇻","unicode": "U+1F1F8 U+1F1FB"}, - "SX": {"emoji": "🇸🇽","unicode": "U+1F1F8 U+1F1FD"}, - "SY": {"emoji": "🇸🇾","unicode": "U+1F1F8 U+1F1FE"}, - "SZ": {"emoji": "🇸🇿","unicode": "U+1F1F8 U+1F1FF"}, - "TC": {"emoji": "🇹🇨","unicode": "U+1F1F9 U+1F1E8"}, - "TD": {"emoji": "🇹🇩","unicode": "U+1F1F9 U+1F1E9"}, - "TF": {"emoji": "🇹🇫","unicode": "U+1F1F9 U+1F1EB"}, - "TG": {"emoji": "🇹🇬","unicode": "U+1F1F9 U+1F1EC"}, - "TH": {"emoji": "🇹🇭","unicode": "U+1F1F9 U+1F1ED"}, - "TJ": {"emoji": "🇹🇯","unicode": "U+1F1F9 U+1F1EF"}, - "TK": {"emoji": "🇹🇰","unicode": "U+1F1F9 U+1F1F0"}, - "TL": {"emoji": "🇹🇱","unicode": "U+1F1F9 U+1F1F1"}, - "TM": {"emoji": "🇹🇲","unicode": "U+1F1F9 U+1F1F2"}, - "TN": {"emoji": "🇹🇳","unicode": "U+1F1F9 U+1F1F3"}, - "TO": {"emoji": "🇹🇴","unicode": "U+1F1F9 U+1F1F4"}, - "TR": {"emoji": "🇹🇷","unicode": "U+1F1F9 U+1F1F7"}, - "TT": {"emoji": "🇹🇹","unicode": "U+1F1F9 U+1F1F9"}, - "TV": {"emoji": "🇹🇻","unicode": "U+1F1F9 U+1F1FB"}, - "TW": {"emoji": "🇹🇼","unicode": "U+1F1F9 U+1F1FC"}, - "TZ": {"emoji": "🇹🇿","unicode": "U+1F1F9 U+1F1FF"}, - "UA": {"emoji": "🇺🇦","unicode": "U+1F1FA U+1F1E6"}, - "UG": {"emoji": "🇺🇬","unicode": "U+1F1FA U+1F1EC"}, - "UM": {"emoji": "🇺🇲","unicode": "U+1F1FA U+1F1F2"}, - "US": {"emoji": "🇺🇸","unicode": "U+1F1FA U+1F1F8"}, - "UY": {"emoji": "🇺🇾","unicode": "U+1F1FA U+1F1FE"}, - "UZ": {"emoji": "🇺🇿","unicode": "U+1F1FA U+1F1FF"}, - "VA": {"emoji": "🇻🇦","unicode": "U+1F1FB U+1F1E6"}, - "VC": {"emoji": "🇻🇨","unicode": "U+1F1FB U+1F1E8"}, - "VE": {"emoji": "🇻🇪","unicode": "U+1F1FB U+1F1EA"}, - "VG": {"emoji": "🇻🇬","unicode": "U+1F1FB U+1F1EC"}, - "VI": {"emoji": "🇻🇮","unicode": "U+1F1FB U+1F1EE"}, - "VN": {"emoji": "🇻🇳","unicode": "U+1F1FB U+1F1F3"}, - "VU": {"emoji": "🇻🇺","unicode": "U+1F1FB U+1F1FA"}, - "WF": {"emoji": "🇼🇫","unicode": "U+1F1FC U+1F1EB"}, - "WS": {"emoji": "🇼🇸","unicode": "U+1F1FC U+1F1F8"}, - "XK": {"emoji": "🇽🇰","unicode": "U+1F1FD U+1F1F0"}, - "YE": {"emoji": "🇾🇪","unicode": "U+1F1FE U+1F1EA"}, - "YT": {"emoji": "🇾🇹","unicode": "U+1F1FE U+1F1F9"}, - "ZA": {"emoji": "🇿🇦","unicode": "U+1F1FF U+1F1E6"}, - "ZM": {"emoji": "🇿🇲","unicode": "U+1F1FF U+1F1F2"}, - "ZW": {"emoji": "🇿🇼","unicode": "U+1F1FF U+1F1FC"} -} diff --git a/ipinfo/flags.py b/ipinfo/flags.py new file mode 100644 index 0000000..d9fdaa9 --- /dev/null +++ b/ipinfo/flags.py @@ -0,0 +1,252 @@ +countries_flags = { + "AD": {"emoji": "🇦🇩", "unicode": "U+1F1E6 U+1F1E9"}, + "AE": {"emoji": "🇦🇪", "unicode": "U+1F1E6 U+1F1EA"}, + "AF": {"emoji": "🇦🇫", "unicode": "U+1F1E6 U+1F1EB"}, + "AG": {"emoji": "🇦🇬", "unicode": "U+1F1E6 U+1F1EC"}, + "AI": {"emoji": "🇦🇮", "unicode": "U+1F1E6 U+1F1EE"}, + "AL": {"emoji": "🇦🇱", "unicode": "U+1F1E6 U+1F1F1"}, + "AM": {"emoji": "🇦🇲", "unicode": "U+1F1E6 U+1F1F2"}, + "AO": {"emoji": "🇦🇴", "unicode": "U+1F1E6 U+1F1F4"}, + "AQ": {"emoji": "🇦🇶", "unicode": "U+1F1E6 U+1F1F6"}, + "AR": {"emoji": "🇦🇷", "unicode": "U+1F1E6 U+1F1F7"}, + "AS": {"emoji": "🇦🇸", "unicode": "U+1F1E6 U+1F1F8"}, + "AT": {"emoji": "🇦🇹", "unicode": "U+1F1E6 U+1F1F9"}, + "AU": {"emoji": "🇦🇺", "unicode": "U+1F1E6 U+1F1FA"}, + "AW": {"emoji": "🇦🇼", "unicode": "U+1F1E6 U+1F1FC"}, + "AX": {"emoji": "🇦🇽", "unicode": "U+1F1E6 U+1F1FD"}, + "AZ": {"emoji": "🇦🇿", "unicode": "U+1F1E6 U+1F1FF"}, + "BA": {"emoji": "🇧🇦", "unicode": "U+1F1E7 U+1F1E6"}, + "BB": {"emoji": "🇧🇧", "unicode": "U+1F1E7 U+1F1E7"}, + "BD": {"emoji": "🇧🇩", "unicode": "U+1F1E7 U+1F1E9"}, + "BE": {"emoji": "🇧🇪", "unicode": "U+1F1E7 U+1F1EA"}, + "BF": {"emoji": "🇧🇫", "unicode": "U+1F1E7 U+1F1EB"}, + "BG": {"emoji": "🇧🇬", "unicode": "U+1F1E7 U+1F1EC"}, + "BH": {"emoji": "🇧🇭", "unicode": "U+1F1E7 U+1F1ED"}, + "BI": {"emoji": "🇧🇮", "unicode": "U+1F1E7 U+1F1EE"}, + "BJ": {"emoji": "🇧🇯", "unicode": "U+1F1E7 U+1F1EF"}, + "BL": {"emoji": "🇧🇱", "unicode": "U+1F1E7 U+1F1F1"}, + "BM": {"emoji": "🇧🇲", "unicode": "U+1F1E7 U+1F1F2"}, + "BN": {"emoji": "🇧🇳", "unicode": "U+1F1E7 U+1F1F3"}, + "BO": {"emoji": "🇧🇴", "unicode": "U+1F1E7 U+1F1F4"}, + "BQ": {"emoji": "🇧🇶", "unicode": "U+1F1E7 U+1F1F6"}, + "BR": {"emoji": "🇧🇷", "unicode": "U+1F1E7 U+1F1F7"}, + "BS": {"emoji": "🇧🇸", "unicode": "U+1F1E7 U+1F1F8"}, + "BT": {"emoji": "🇧🇹", "unicode": "U+1F1E7 U+1F1F9"}, + "BV": {"emoji": "🇧🇻", "unicode": "U+1F1E7 U+1F1FB"}, + "BW": {"emoji": "🇧🇼", "unicode": "U+1F1E7 U+1F1FC"}, + "BY": {"emoji": "🇧🇾", "unicode": "U+1F1E7 U+1F1FE"}, + "BZ": {"emoji": "🇧🇿", "unicode": "U+1F1E7 U+1F1FF"}, + "CA": {"emoji": "🇨🇦", "unicode": "U+1F1E8 U+1F1E6"}, + "CC": {"emoji": "🇨🇨", "unicode": "U+1F1E8 U+1F1E8"}, + "CD": {"emoji": "🇨🇩", "unicode": "U+1F1E8 U+1F1E9"}, + "CF": {"emoji": "🇨🇫", "unicode": "U+1F1E8 U+1F1EB"}, + "CG": {"emoji": "🇨🇬", "unicode": "U+1F1E8 U+1F1EC"}, + "CH": {"emoji": "🇨🇭", "unicode": "U+1F1E8 U+1F1ED"}, + "CI": {"emoji": "🇨🇮", "unicode": "U+1F1E8 U+1F1EE"}, + "CK": {"emoji": "🇨🇰", "unicode": "U+1F1E8 U+1F1F0"}, + "CL": {"emoji": "🇨🇱", "unicode": "U+1F1E8 U+1F1F1"}, + "CM": {"emoji": "🇨🇲", "unicode": "U+1F1E8 U+1F1F2"}, + "CN": {"emoji": "🇨🇳", "unicode": "U+1F1E8 U+1F1F3"}, + "CO": {"emoji": "🇨🇴", "unicode": "U+1F1E8 U+1F1F4"}, + "CR": {"emoji": "🇨🇷", "unicode": "U+1F1E8 U+1F1F7"}, + "CU": {"emoji": "🇨🇺", "unicode": "U+1F1E8 U+1F1FA"}, + "CV": {"emoji": "🇨🇻", "unicode": "U+1F1E8 U+1F1FB"}, + "CW": {"emoji": "🇨🇼", "unicode": "U+1F1E8 U+1F1FC"}, + "CX": {"emoji": "🇨🇽", "unicode": "U+1F1E8 U+1F1FD"}, + "CY": {"emoji": "🇨🇾", "unicode": "U+1F1E8 U+1F1FE"}, + "CZ": {"emoji": "🇨🇿", "unicode": "U+1F1E8 U+1F1FF"}, + "DE": {"emoji": "🇩🇪", "unicode": "U+1F1E9 U+1F1EA"}, + "DJ": {"emoji": "🇩🇯", "unicode": "U+1F1E9 U+1F1EF"}, + "DK": {"emoji": "🇩🇰", "unicode": "U+1F1E9 U+1F1F0"}, + "DM": {"emoji": "🇩🇲", "unicode": "U+1F1E9 U+1F1F2"}, + "DO": {"emoji": "🇩🇴", "unicode": "U+1F1E9 U+1F1F4"}, + "DZ": {"emoji": "🇩🇿", "unicode": "U+1F1E9 U+1F1FF"}, + "EC": {"emoji": "🇪🇨", "unicode": "U+1F1EA U+1F1E8"}, + "EE": {"emoji": "🇪🇪", "unicode": "U+1F1EA U+1F1EA"}, + "EG": {"emoji": "🇪🇬", "unicode": "U+1F1EA U+1F1EC"}, + "EH": {"emoji": "🇪🇭", "unicode": "U+1F1EA U+1F1ED"}, + "ER": {"emoji": "🇪🇷", "unicode": "U+1F1EA U+1F1F7"}, + "ES": {"emoji": "🇪🇸", "unicode": "U+1F1EA U+1F1F8"}, + "ET": {"emoji": "🇪🇹", "unicode": "U+1F1EA U+1F1F9"}, + "FI": {"emoji": "🇫🇮", "unicode": "U+1F1EB U+1F1EE"}, + "FJ": {"emoji": "🇫🇯", "unicode": "U+1F1EB U+1F1EF"}, + "FK": {"emoji": "🇫🇰", "unicode": "U+1F1EB U+1F1F0"}, + "FM": {"emoji": "🇫🇲", "unicode": "U+1F1EB U+1F1F2"}, + "FO": {"emoji": "🇫🇴", "unicode": "U+1F1EB U+1F1F4"}, + "FR": {"emoji": "🇫🇷", "unicode": "U+1F1EB U+1F1F7"}, + "GA": {"emoji": "🇬🇦", "unicode": "U+1F1EC U+1F1E6"}, + "GB": {"emoji": "🇬🇧", "unicode": "U+1F1EC U+1F1E7"}, + "GD": {"emoji": "🇬🇩", "unicode": "U+1F1EC U+1F1E9"}, + "GE": {"emoji": "🇬🇪", "unicode": "U+1F1EC U+1F1EA"}, + "GF": {"emoji": "🇬🇫", "unicode": "U+1F1EC U+1F1EB"}, + "GG": {"emoji": "🇬🇬", "unicode": "U+1F1EC U+1F1EC"}, + "GH": {"emoji": "🇬🇭", "unicode": "U+1F1EC U+1F1ED"}, + "GI": {"emoji": "🇬🇮", "unicode": "U+1F1EC U+1F1EE"}, + "GL": {"emoji": "🇬🇱", "unicode": "U+1F1EC U+1F1F1"}, + "GM": {"emoji": "🇬🇲", "unicode": "U+1F1EC U+1F1F2"}, + "GN": {"emoji": "🇬🇳", "unicode": "U+1F1EC U+1F1F3"}, + "GP": {"emoji": "🇬🇵", "unicode": "U+1F1EC U+1F1F5"}, + "GQ": {"emoji": "🇬🇶", "unicode": "U+1F1EC U+1F1F6"}, + "GR": {"emoji": "🇬🇷", "unicode": "U+1F1EC U+1F1F7"}, + "GS": {"emoji": "🇬🇸", "unicode": "U+1F1EC U+1F1F8"}, + "GT": {"emoji": "🇬🇹", "unicode": "U+1F1EC U+1F1F9"}, + "GU": {"emoji": "🇬🇺", "unicode": "U+1F1EC U+1F1FA"}, + "GW": {"emoji": "🇬🇼", "unicode": "U+1F1EC U+1F1FC"}, + "GY": {"emoji": "🇬🇾", "unicode": "U+1F1EC U+1F1FE"}, + "HK": {"emoji": "🇭🇰", "unicode": "U+1F1ED U+1F1F0"}, + "HM": {"emoji": "🇭🇲", "unicode": "U+1F1ED U+1F1F2"}, + "HN": {"emoji": "🇭🇳", "unicode": "U+1F1ED U+1F1F3"}, + "HR": {"emoji": "🇭🇷", "unicode": "U+1F1ED U+1F1F7"}, + "HT": {"emoji": "🇭🇹", "unicode": "U+1F1ED U+1F1F9"}, + "HU": {"emoji": "🇭🇺", "unicode": "U+1F1ED U+1F1FA"}, + "ID": {"emoji": "🇮🇩", "unicode": "U+1F1EE U+1F1E9"}, + "IE": {"emoji": "🇮🇪", "unicode": "U+1F1EE U+1F1EA"}, + "IL": {"emoji": "🇮🇱", "unicode": "U+1F1EE U+1F1F1"}, + "IM": {"emoji": "🇮🇲", "unicode": "U+1F1EE U+1F1F2"}, + "IN": {"emoji": "🇮🇳", "unicode": "U+1F1EE U+1F1F3"}, + "IO": {"emoji": "🇮🇴", "unicode": "U+1F1EE U+1F1F4"}, + "IQ": {"emoji": "🇮🇶", "unicode": "U+1F1EE U+1F1F6"}, + "IR": {"emoji": "🇮🇷", "unicode": "U+1F1EE U+1F1F7"}, + "IS": {"emoji": "🇮🇸", "unicode": "U+1F1EE U+1F1F8"}, + "IT": {"emoji": "🇮🇹", "unicode": "U+1F1EE U+1F1F9"}, + "JE": {"emoji": "🇯🇪", "unicode": "U+1F1EF U+1F1EA"}, + "JM": {"emoji": "🇯🇲", "unicode": "U+1F1EF U+1F1F2"}, + "JO": {"emoji": "🇯🇴", "unicode": "U+1F1EF U+1F1F4"}, + "JP": {"emoji": "🇯🇵", "unicode": "U+1F1EF U+1F1F5"}, + "KE": {"emoji": "🇰🇪", "unicode": "U+1F1F0 U+1F1EA"}, + "KG": {"emoji": "🇰🇬", "unicode": "U+1F1F0 U+1F1EC"}, + "KH": {"emoji": "🇰🇭", "unicode": "U+1F1F0 U+1F1ED"}, + "KI": {"emoji": "🇰🇮", "unicode": "U+1F1F0 U+1F1EE"}, + "KM": {"emoji": "🇰🇲", "unicode": "U+1F1F0 U+1F1F2"}, + "KN": {"emoji": "🇰🇳", "unicode": "U+1F1F0 U+1F1F3"}, + "KP": {"emoji": "🇰🇵", "unicode": "U+1F1F0 U+1F1F5"}, + "KR": {"emoji": "🇰🇷", "unicode": "U+1F1F0 U+1F1F7"}, + "KW": {"emoji": "🇰🇼", "unicode": "U+1F1F0 U+1F1FC"}, + "KY": {"emoji": "🇰🇾", "unicode": "U+1F1F0 U+1F1FE"}, + "KZ": {"emoji": "🇰🇿", "unicode": "U+1F1F0 U+1F1FF"}, + "LA": {"emoji": "🇱🇦", "unicode": "U+1F1F1 U+1F1E6"}, + "LB": {"emoji": "🇱🇧", "unicode": "U+1F1F1 U+1F1E7"}, + "LC": {"emoji": "🇱🇨", "unicode": "U+1F1F1 U+1F1E8"}, + "LI": {"emoji": "🇱🇮", "unicode": "U+1F1F1 U+1F1EE"}, + "LK": {"emoji": "🇱🇰", "unicode": "U+1F1F1 U+1F1F0"}, + "LR": {"emoji": "🇱🇷", "unicode": "U+1F1F1 U+1F1F7"}, + "LS": {"emoji": "🇱🇸", "unicode": "U+1F1F1 U+1F1F8"}, + "LT": {"emoji": "🇱🇹", "unicode": "U+1F1F1 U+1F1F9"}, + "LU": {"emoji": "🇱🇺", "unicode": "U+1F1F1 U+1F1FA"}, + "LV": {"emoji": "🇱🇻", "unicode": "U+1F1F1 U+1F1FB"}, + "LY": {"emoji": "🇱🇾", "unicode": "U+1F1F1 U+1F1FE"}, + "MA": {"emoji": "🇲🇦", "unicode": "U+1F1F2 U+1F1E6"}, + "MC": {"emoji": "🇲🇨", "unicode": "U+1F1F2 U+1F1E8"}, + "MD": {"emoji": "🇲🇩", "unicode": "U+1F1F2 U+1F1E9"}, + "ME": {"emoji": "🇲🇪", "unicode": "U+1F1F2 U+1F1EA"}, + "MF": {"emoji": "🇲🇫", "unicode": "U+1F1F2 U+1F1EB"}, + "MG": {"emoji": "🇲🇬", "unicode": "U+1F1F2 U+1F1EC"}, + "MH": {"emoji": "🇲🇭", "unicode": "U+1F1F2 U+1F1ED"}, + "MK": {"emoji": "🇲🇰", "unicode": "U+1F1F2 U+1F1F0"}, + "ML": {"emoji": "🇲🇱", "unicode": "U+1F1F2 U+1F1F1"}, + "MM": {"emoji": "🇲🇲", "unicode": "U+1F1F2 U+1F1F2"}, + "MN": {"emoji": "🇲🇳", "unicode": "U+1F1F2 U+1F1F3"}, + "MO": {"emoji": "🇲🇴", "unicode": "U+1F1F2 U+1F1F4"}, + "MP": {"emoji": "🇲🇵", "unicode": "U+1F1F2 U+1F1F5"}, + "MQ": {"emoji": "🇲🇶", "unicode": "U+1F1F2 U+1F1F6"}, + "MR": {"emoji": "🇲🇷", "unicode": "U+1F1F2 U+1F1F7"}, + "MS": {"emoji": "🇲🇸", "unicode": "U+1F1F2 U+1F1F8"}, + "MT": {"emoji": "🇲🇹", "unicode": "U+1F1F2 U+1F1F9"}, + "MU": {"emoji": "🇲🇺", "unicode": "U+1F1F2 U+1F1FA"}, + "MV": {"emoji": "🇲🇻", "unicode": "U+1F1F2 U+1F1FB"}, + "MW": {"emoji": "🇲🇼", "unicode": "U+1F1F2 U+1F1FC"}, + "MX": {"emoji": "🇲🇽", "unicode": "U+1F1F2 U+1F1FD"}, + "MY": {"emoji": "🇲🇾", "unicode": "U+1F1F2 U+1F1FE"}, + "MZ": {"emoji": "🇲🇿", "unicode": "U+1F1F2 U+1F1FF"}, + "NA": {"emoji": "🇳🇦", "unicode": "U+1F1F3 U+1F1E6"}, + "NC": {"emoji": "🇳🇨", "unicode": "U+1F1F3 U+1F1E8"}, + "NE": {"emoji": "🇳🇪", "unicode": "U+1F1F3 U+1F1EA"}, + "NF": {"emoji": "🇳🇫", "unicode": "U+1F1F3 U+1F1EB"}, + "NG": {"emoji": "🇳🇬", "unicode": "U+1F1F3 U+1F1EC"}, + "NI": {"emoji": "🇳🇮", "unicode": "U+1F1F3 U+1F1EE"}, + "NL": {"emoji": "🇳🇱", "unicode": "U+1F1F3 U+1F1F1"}, + "NO": {"emoji": "🇳🇴", "unicode": "U+1F1F3 U+1F1F4"}, + "NP": {"emoji": "🇳🇵", "unicode": "U+1F1F3 U+1F1F5"}, + "NR": {"emoji": "🇳🇷", "unicode": "U+1F1F3 U+1F1F7"}, + "NU": {"emoji": "🇳🇺", "unicode": "U+1F1F3 U+1F1FA"}, + "NZ": {"emoji": "🇳🇿", "unicode": "U+1F1F3 U+1F1FF"}, + "OM": {"emoji": "🇴🇲", "unicode": "U+1F1F4 U+1F1F2"}, + "PA": {"emoji": "🇵🇦", "unicode": "U+1F1F5 U+1F1E6"}, + "PE": {"emoji": "🇵🇪", "unicode": "U+1F1F5 U+1F1EA"}, + "PF": {"emoji": "🇵🇫", "unicode": "U+1F1F5 U+1F1EB"}, + "PG": {"emoji": "🇵🇬", "unicode": "U+1F1F5 U+1F1EC"}, + "PH": {"emoji": "🇵🇭", "unicode": "U+1F1F5 U+1F1ED"}, + "PK": {"emoji": "🇵🇰", "unicode": "U+1F1F5 U+1F1F0"}, + "PL": {"emoji": "🇵🇱", "unicode": "U+1F1F5 U+1F1F1"}, + "PM": {"emoji": "🇵🇲", "unicode": "U+1F1F5 U+1F1F2"}, + "PN": {"emoji": "🇵🇳", "unicode": "U+1F1F5 U+1F1F3"}, + "PR": {"emoji": "🇵🇷", "unicode": "U+1F1F5 U+1F1F7"}, + "PS": {"emoji": "🇵🇸", "unicode": "U+1F1F5 U+1F1F8"}, + "PT": {"emoji": "🇵🇹", "unicode": "U+1F1F5 U+1F1F9"}, + "PW": {"emoji": "🇵🇼", "unicode": "U+1F1F5 U+1F1FC"}, + "PY": {"emoji": "🇵🇾", "unicode": "U+1F1F5 U+1F1FE"}, + "QA": {"emoji": "🇶🇦", "unicode": "U+1F1F6 U+1F1E6"}, + "RE": {"emoji": "🇷🇪", "unicode": "U+1F1F7 U+1F1EA"}, + "RO": {"emoji": "🇷🇴", "unicode": "U+1F1F7 U+1F1F4"}, + "RS": {"emoji": "🇷🇸", "unicode": "U+1F1F7 U+1F1F8"}, + "RU": {"emoji": "🇷🇺", "unicode": "U+1F1F7 U+1F1FA"}, + "RW": {"emoji": "🇷🇼", "unicode": "U+1F1F7 U+1F1FC"}, + "SA": {"emoji": "🇸🇦", "unicode": "U+1F1F8 U+1F1E6"}, + "SB": {"emoji": "🇸🇧", "unicode": "U+1F1F8 U+1F1E7"}, + "SC": {"emoji": "🇸🇨", "unicode": "U+1F1F8 U+1F1E8"}, + "SD": {"emoji": "🇸🇩", "unicode": "U+1F1F8 U+1F1E9"}, + "SE": {"emoji": "🇸🇪", "unicode": "U+1F1F8 U+1F1EA"}, + "SG": {"emoji": "🇸🇬", "unicode": "U+1F1F8 U+1F1EC"}, + "SH": {"emoji": "🇸🇭", "unicode": "U+1F1F8 U+1F1ED"}, + "SI": {"emoji": "🇸🇮", "unicode": "U+1F1F8 U+1F1EE"}, + "SJ": {"emoji": "🇸🇯", "unicode": "U+1F1F8 U+1F1EF"}, + "SK": {"emoji": "🇸🇰", "unicode": "U+1F1F8 U+1F1F0"}, + "SL": {"emoji": "🇸🇱", "unicode": "U+1F1F8 U+1F1F1"}, + "SM": {"emoji": "🇸🇲", "unicode": "U+1F1F8 U+1F1F2"}, + "SN": {"emoji": "🇸🇳", "unicode": "U+1F1F8 U+1F1F3"}, + "SO": {"emoji": "🇸🇴", "unicode": "U+1F1F8 U+1F1F4"}, + "SR": {"emoji": "🇸🇷", "unicode": "U+1F1F8 U+1F1F7"}, + "SS": {"emoji": "🇸🇸", "unicode": "U+1F1F8 U+1F1F8"}, + "ST": {"emoji": "🇸🇹", "unicode": "U+1F1F8 U+1F1F9"}, + "SV": {"emoji": "🇸🇻", "unicode": "U+1F1F8 U+1F1FB"}, + "SX": {"emoji": "🇸🇽", "unicode": "U+1F1F8 U+1F1FD"}, + "SY": {"emoji": "🇸🇾", "unicode": "U+1F1F8 U+1F1FE"}, + "SZ": {"emoji": "🇸🇿", "unicode": "U+1F1F8 U+1F1FF"}, + "TC": {"emoji": "🇹🇨", "unicode": "U+1F1F9 U+1F1E8"}, + "TD": {"emoji": "🇹🇩", "unicode": "U+1F1F9 U+1F1E9"}, + "TF": {"emoji": "🇹🇫", "unicode": "U+1F1F9 U+1F1EB"}, + "TG": {"emoji": "🇹🇬", "unicode": "U+1F1F9 U+1F1EC"}, + "TH": {"emoji": "🇹🇭", "unicode": "U+1F1F9 U+1F1ED"}, + "TJ": {"emoji": "🇹🇯", "unicode": "U+1F1F9 U+1F1EF"}, + "TK": {"emoji": "🇹🇰", "unicode": "U+1F1F9 U+1F1F0"}, + "TL": {"emoji": "🇹🇱", "unicode": "U+1F1F9 U+1F1F1"}, + "TM": {"emoji": "🇹🇲", "unicode": "U+1F1F9 U+1F1F2"}, + "TN": {"emoji": "🇹🇳", "unicode": "U+1F1F9 U+1F1F3"}, + "TO": {"emoji": "🇹🇴", "unicode": "U+1F1F9 U+1F1F4"}, + "TR": {"emoji": "🇹🇷", "unicode": "U+1F1F9 U+1F1F7"}, + "TT": {"emoji": "🇹🇹", "unicode": "U+1F1F9 U+1F1F9"}, + "TV": {"emoji": "🇹🇻", "unicode": "U+1F1F9 U+1F1FB"}, + "TW": {"emoji": "🇹🇼", "unicode": "U+1F1F9 U+1F1FC"}, + "TZ": {"emoji": "🇹🇿", "unicode": "U+1F1F9 U+1F1FF"}, + "UA": {"emoji": "🇺🇦", "unicode": "U+1F1FA U+1F1E6"}, + "UG": {"emoji": "🇺🇬", "unicode": "U+1F1FA U+1F1EC"}, + "UM": {"emoji": "🇺🇲", "unicode": "U+1F1FA U+1F1F2"}, + "US": {"emoji": "🇺🇸", "unicode": "U+1F1FA U+1F1F8"}, + "UY": {"emoji": "🇺🇾", "unicode": "U+1F1FA U+1F1FE"}, + "UZ": {"emoji": "🇺🇿", "unicode": "U+1F1FA U+1F1FF"}, + "VA": {"emoji": "🇻🇦", "unicode": "U+1F1FB U+1F1E6"}, + "VC": {"emoji": "🇻🇨", "unicode": "U+1F1FB U+1F1E8"}, + "VE": {"emoji": "🇻🇪", "unicode": "U+1F1FB U+1F1EA"}, + "VG": {"emoji": "🇻🇬", "unicode": "U+1F1FB U+1F1EC"}, + "VI": {"emoji": "🇻🇮", "unicode": "U+1F1FB U+1F1EE"}, + "VN": {"emoji": "🇻🇳", "unicode": "U+1F1FB U+1F1F3"}, + "VU": {"emoji": "🇻🇺", "unicode": "U+1F1FB U+1F1FA"}, + "WF": {"emoji": "🇼🇫", "unicode": "U+1F1FC U+1F1EB"}, + "WS": {"emoji": "🇼🇸", "unicode": "U+1F1FC U+1F1F8"}, + "XK": {"emoji": "🇽🇰", "unicode": "U+1F1FD U+1F1F0"}, + "YE": {"emoji": "🇾🇪", "unicode": "U+1F1FE U+1F1EA"}, + "YT": {"emoji": "🇾🇹", "unicode": "U+1F1FE U+1F1F9"}, + "ZA": {"emoji": "🇿🇦", "unicode": "U+1F1FF U+1F1E6"}, + "ZM": {"emoji": "🇿🇲", "unicode": "U+1F1FF U+1F1F2"}, + "ZW": {"emoji": "🇿🇼", "unicode": "U+1F1FF U+1F1FC"} +} diff --git a/ipinfo/handler.py b/ipinfo/handler.py index 3c1cb92..4b7ef6d 100644 --- a/ipinfo/handler.py +++ b/ipinfo/handler.py @@ -16,11 +16,6 @@ from .exceptions import RequestQuotaExceededError, TimeoutExceededError from .handler_utils import ( API_URL, - COUNTRY_FILE_DEFAULT, - COUNTRY_EU_FILE_DEFAULT, - COUNTRY_FLAG_FILE_DEFAULT, - COUNTRY_CURRENCY_FILE_DEFAULT, - CONTINENT_FILE_DEFAULT, BATCH_MAX_SIZE, CACHE_MAXSIZE, CACHE_TTL, @@ -30,6 +25,11 @@ ) from . import handler_utils from .bogon import is_bogon +from .continent import continents +from .countries import countries +from .currency import countries_currencies +from .eu import eu_countries +from .flags import countries_flags class Handler: @@ -46,39 +46,19 @@ def __init__(self, access_token=None, **kwargs): self.access_token = access_token # load countries file - self.countries = handler_utils.read_json_file( - kwargs.get("countries_file") - if kwargs.get("countries_file") - else COUNTRY_FILE_DEFAULT - ) + self.countries = countries # load eu countries file - self.eu_countries = handler_utils.read_json_file( - kwargs.get("eu_countries_file") - if kwargs.get("eu_countries_file") - else COUNTRY_EU_FILE_DEFAULT - ) + self.eu_countries = eu_countries # load countries flags file - self.countries_flags = handler_utils.read_json_file( - kwargs.get("countries_flags_file") - if kwargs.get("countries_flags_file") - else COUNTRY_FLAG_FILE_DEFAULT - ) + self.countries_flags = countries_flags # load countries currency file - self.countries_currencies = handler_utils.read_json_file( - kwargs.get("countries_currencies_file") - if kwargs.get("countries_currencies_file") - else COUNTRY_CURRENCY_FILE_DEFAULT - ) + self.countries_currencies = countries_currencies # load continent file - self.continents = handler_utils.read_json_file( - kwargs.get("continent_file") - if kwargs.get("continent_file") - else CONTINENT_FILE_DEFAULT - ) + self.continents = continents # setup req opts self.request_options = kwargs.get("request_options", {}) diff --git a/ipinfo/handler_async.py b/ipinfo/handler_async.py index 9567584..ec91a79 100644 --- a/ipinfo/handler_async.py +++ b/ipinfo/handler_async.py @@ -17,11 +17,6 @@ from .exceptions import RequestQuotaExceededError, TimeoutExceededError from .handler_utils import ( API_URL, - COUNTRY_EU_FILE_DEFAULT, - COUNTRY_FILE_DEFAULT, - COUNTRY_FLAG_FILE_DEFAULT, - COUNTRY_CURRENCY_FILE_DEFAULT, - CONTINENT_FILE_DEFAULT, BATCH_MAX_SIZE, CACHE_MAXSIZE, CACHE_TTL, @@ -31,6 +26,11 @@ ) from . import handler_utils from .bogon import is_bogon +from .continent import continents +from .countries import countries +from .currency import countries_currencies +from .eu import eu_countries +from .flags import countries_flags class AsyncHandler: @@ -47,39 +47,19 @@ def __init__(self, access_token=None, **kwargs): self.access_token = access_token # load countries file - self.countries = handler_utils.read_json_file( - kwargs.get("countries_file") - if kwargs.get("countries_file") - else COUNTRY_FILE_DEFAULT - ) + self.countries = countries # load eu countries file - self.eu_countries = handler_utils.read_json_file( - kwargs.get("eu_countries_file") - if kwargs.get("eu_countries_file") - else COUNTRY_EU_FILE_DEFAULT - ) + self.eu_countries = eu_countries # load countries flags file - self.countries_flags = handler_utils.read_json_file( - kwargs.get("countries_flags_file") - if kwargs.get("countries_flags_file") - else COUNTRY_FLAG_FILE_DEFAULT - ) + self.countries_flags = countries_flags # load countries currency file - self.countries_currencies = handler_utils.read_json_file( - kwargs.get("countries_currencies_file") - if kwargs.get("countries_currencies_file") - else COUNTRY_CURRENCY_FILE_DEFAULT - ) + self.countries_currencies = countries_currencies # load continent file - self.continents = handler_utils.read_json_file( - kwargs.get("continent_file") - if kwargs.get("continent_file") - else CONTINENT_FILE_DEFAULT - ) + self.continents = continents # setup req opts self.request_options = kwargs.get("request_options", {}) diff --git a/ipinfo/handler_utils.py b/ipinfo/handler_utils.py index 3cc0f34..782dfa2 100644 --- a/ipinfo/handler_utils.py +++ b/ipinfo/handler_utils.py @@ -16,18 +16,6 @@ # "PK" -> "https://cdn.ipinfo.io/static/images/countries-flags/PK.svg" COUNTRY_FLAGS_URL = "https://cdn.ipinfo.io/static/images/countries-flags/" -# Used to transform incoming responses with country abbreviations into the full -# expanded country name, e.g. "PK" -> "Pakistan". -COUNTRY_FILE_DEFAULT = "countries.json" - -COUNTRY_EU_FILE_DEFAULT = "eu.json" - -COUNTRY_FLAG_FILE_DEFAULT = "flags.json" - -COUNTRY_CURRENCY_FILE_DEFAULT = "currency.json" - -CONTINENT_FILE_DEFAULT = "continent.json" - # The max amount of IPs allowed by the API per batch request. BATCH_MAX_SIZE = 1000 From 45580737520dcf615116ab4fee42c1745379b2a4 Mon Sep 17 00:00:00 2001 From: harisabdullah Date: Mon, 20 Nov 2023 17:13:34 +0500 Subject: [PATCH 02/15] Improved structure | Review suggestions --- ipinfo/continent.py | 255 --------- ipinfo/countries.py | 3 - ipinfo/currency.py | 252 --------- ipinfo/data.py | 1042 +++++++++++++++++++++++++++++++++++ ipinfo/details.py | 4 +- ipinfo/eu.py | 2 - ipinfo/flags.py | 252 --------- ipinfo/handler.py | 29 +- ipinfo/handler_async.py | 29 +- ipinfo/handler_utils.py | 14 +- tests/handler_async_test.py | 1 + 11 files changed, 1090 insertions(+), 793 deletions(-) delete mode 100644 ipinfo/continent.py delete mode 100644 ipinfo/countries.py delete mode 100644 ipinfo/currency.py create mode 100644 ipinfo/data.py delete mode 100644 ipinfo/eu.py delete mode 100644 ipinfo/flags.py diff --git a/ipinfo/continent.py b/ipinfo/continent.py deleted file mode 100644 index 59ad265..0000000 --- a/ipinfo/continent.py +++ /dev/null @@ -1,255 +0,0 @@ -continents = { - "BD": {"code": "AS", "name": "Asia"}, - "BE": {"code": "EU", "name": "Europe"}, - "BF": {"code": "AF", "name": "Africa"}, - "BG": {"code": "EU", "name": "Europe"}, - "BA": {"code": "EU", "name": "Europe"}, - "BB": {"code": "NA", "name": "North America"}, - "WF": {"code": "OC", "name": "Oceania"}, - "BL": {"code": "NA", "name": "North America"}, - "BM": {"code": "NA", "name": "North America"}, - "BN": {"code": "AS", "name": "Asia"}, - "BO": {"code": "SA", "name": "South America"}, - "BH": {"code": "AS", "name": "Asia"}, - "BI": {"code": "AF", "name": "Africa"}, - "BJ": {"code": "AF", "name": "Africa"}, - "BT": {"code": "AS", "name": "Asia"}, - "JM": {"code": "NA", "name": "North America"}, - "BV": {"code": "AN", "name": "Antarctica"}, - "BW": {"code": "AF", "name": "Africa"}, - "WS": {"code": "OC", "name": "Oceania"}, - "BQ": {"code": "NA", "name": "North America"}, - "BR": {"code": "SA", "name": "South America"}, - "BS": {"code": "NA", "name": "North America"}, - "JE": {"code": "EU", "name": "Europe"}, - "BY": {"code": "EU", "name": "Europe"}, - "BZ": {"code": "NA", "name": "North America"}, - "RU": {"code": "EU", "name": "Europe"}, - "RW": {"code": "AF", "name": "Africa"}, - "RS": {"code": "EU", "name": "Europe"}, - "TL": {"code": "OC", "name": "Oceania"}, - "RE": {"code": "AF", "name": "Africa"}, - "TM": {"code": "AS", "name": "Asia"}, - "TJ": {"code": "AS", "name": "Asia"}, - "RO": {"code": "EU", "name": "Europe"}, - "TK": {"code": "OC", "name": "Oceania"}, - "GW": {"code": "AF", "name": "Africa"}, - "GU": {"code": "OC", "name": "Oceania"}, - "GT": {"code": "NA", "name": "North America"}, - "GS": {"code": "AN", "name": "Antarctica"}, - "GR": {"code": "EU", "name": "Europe"}, - "GQ": {"code": "AF", "name": "Africa"}, - "GP": {"code": "NA", "name": "North America"}, - "JP": {"code": "AS", "name": "Asia"}, - "GY": {"code": "SA", "name": "South America"}, - "GG": {"code": "EU", "name": "Europe"}, - "GF": {"code": "SA", "name": "South America"}, - "GE": {"code": "AS", "name": "Asia"}, - "GD": {"code": "NA", "name": "North America"}, - "GB": {"code": "EU", "name": "Europe"}, - "GA": {"code": "AF", "name": "Africa"}, - "SV": {"code": "NA", "name": "North America"}, - "GN": {"code": "AF", "name": "Africa"}, - "GM": {"code": "AF", "name": "Africa"}, - "GL": {"code": "NA", "name": "North America"}, - "GI": {"code": "EU", "name": "Europe"}, - "GH": {"code": "AF", "name": "Africa"}, - "OM": {"code": "AS", "name": "Asia"}, - "TN": {"code": "AF", "name": "Africa"}, - "JO": {"code": "AS", "name": "Asia"}, - "HR": {"code": "EU", "name": "Europe"}, - "HT": {"code": "NA", "name": "North America"}, - "HU": {"code": "EU", "name": "Europe"}, - "HK": {"code": "AS", "name": "Asia"}, - "HN": {"code": "NA", "name": "North America"}, - "HM": {"code": "AN", "name": "Antarctica"}, - "VE": {"code": "SA", "name": "South America"}, - "PR": {"code": "NA", "name": "North America"}, - "PS": {"code": "AS", "name": "Asia"}, - "PW": {"code": "OC", "name": "Oceania"}, - "PT": {"code": "EU", "name": "Europe"}, - "SJ": {"code": "EU", "name": "Europe"}, - "PY": {"code": "SA", "name": "South America"}, - "IQ": {"code": "AS", "name": "Asia"}, - "PA": {"code": "NA", "name": "North America"}, - "PF": {"code": "OC", "name": "Oceania"}, - "PG": {"code": "OC", "name": "Oceania"}, - "PE": {"code": "SA", "name": "South America"}, - "PK": {"code": "AS", "name": "Asia"}, - "PH": {"code": "AS", "name": "Asia"}, - "PN": {"code": "OC", "name": "Oceania"}, - "PL": {"code": "EU", "name": "Europe"}, - "PM": {"code": "NA", "name": "North America"}, - "ZM": {"code": "AF", "name": "Africa"}, - "EH": {"code": "AF", "name": "Africa"}, - "EE": {"code": "EU", "name": "Europe"}, - "EG": {"code": "AF", "name": "Africa"}, - "ZA": {"code": "AF", "name": "Africa"}, - "EC": {"code": "SA", "name": "South America"}, - "IT": {"code": "EU", "name": "Europe"}, - "VN": {"code": "AS", "name": "Asia"}, - "SB": {"code": "OC", "name": "Oceania"}, - "ET": {"code": "AF", "name": "Africa"}, - "SO": {"code": "AF", "name": "Africa"}, - "ZW": {"code": "AF", "name": "Africa"}, - "SA": {"code": "AS", "name": "Asia"}, - "ES": {"code": "EU", "name": "Europe"}, - "ER": {"code": "AF", "name": "Africa"}, - "ME": {"code": "EU", "name": "Europe"}, - "MD": {"code": "EU", "name": "Europe"}, - "MG": {"code": "AF", "name": "Africa"}, - "MF": {"code": "NA", "name": "North America"}, - "MA": {"code": "AF", "name": "Africa"}, - "MC": {"code": "EU", "name": "Europe"}, - "UZ": {"code": "AS", "name": "Asia"}, - "MM": {"code": "AS", "name": "Asia"}, - "ML": {"code": "AF", "name": "Africa"}, - "MO": {"code": "AS", "name": "Asia"}, - "MN": {"code": "AS", "name": "Asia"}, - "MH": {"code": "OC", "name": "Oceania"}, - "MK": {"code": "EU", "name": "Europe"}, - "MU": {"code": "AF", "name": "Africa"}, - "MT": {"code": "EU", "name": "Europe"}, - "MW": {"code": "AF", "name": "Africa"}, - "MV": {"code": "AS", "name": "Asia"}, - "MQ": {"code": "NA", "name": "North America"}, - "MP": {"code": "OC", "name": "Oceania"}, - "MS": {"code": "NA", "name": "North America"}, - "MR": {"code": "AF", "name": "Africa"}, - "IM": {"code": "EU", "name": "Europe"}, - "UG": {"code": "AF", "name": "Africa"}, - "TZ": {"code": "AF", "name": "Africa"}, - "MY": {"code": "AS", "name": "Asia"}, - "MX": {"code": "NA", "name": "North America"}, - "IL": {"code": "AS", "name": "Asia"}, - "FR": {"code": "EU", "name": "Europe"}, - "IO": {"code": "AS", "name": "Asia"}, - "SH": {"code": "AF", "name": "Africa"}, - "FI": {"code": "EU", "name": "Europe"}, - "FJ": {"code": "OC", "name": "Oceania"}, - "FK": {"code": "SA", "name": "South America"}, - "FM": {"code": "OC", "name": "Oceania"}, - "FO": {"code": "EU", "name": "Europe"}, - "NI": {"code": "NA", "name": "North America"}, - "NL": {"code": "EU", "name": "Europe"}, - "NO": {"code": "EU", "name": "Europe"}, - "NA": {"code": "AF", "name": "Africa"}, - "VU": {"code": "OC", "name": "Oceania"}, - "NC": {"code": "OC", "name": "Oceania"}, - "NE": {"code": "AF", "name": "Africa"}, - "NF": {"code": "OC", "name": "Oceania"}, - "NG": {"code": "AF", "name": "Africa"}, - "NZ": {"code": "OC", "name": "Oceania"}, - "NP": {"code": "AS", "name": "Asia"}, - "NR": {"code": "OC", "name": "Oceania"}, - "NU": {"code": "OC", "name": "Oceania"}, - "CK": {"code": "OC", "name": "Oceania"}, - "XK": {"code": "EU", "name": "Europe"}, - "CI": {"code": "AF", "name": "Africa"}, - "CH": {"code": "EU", "name": "Europe"}, - "CO": {"code": "SA", "name": "South America"}, - "CN": {"code": "AS", "name": "Asia"}, - "CM": {"code": "AF", "name": "Africa"}, - "CL": {"code": "SA", "name": "South America"}, - "CC": {"code": "AS", "name": "Asia"}, - "CA": {"code": "NA", "name": "North America"}, - "CG": {"code": "AF", "name": "Africa"}, - "CF": {"code": "AF", "name": "Africa"}, - "CD": {"code": "AF", "name": "Africa"}, - "CZ": {"code": "EU", "name": "Europe"}, - "CY": {"code": "EU", "name": "Europe"}, - "CX": {"code": "AS", "name": "Asia"}, - "CR": {"code": "NA", "name": "North America"}, - "CW": {"code": "NA", "name": "North America"}, - "CV": {"code": "AF", "name": "Africa"}, - "CU": {"code": "NA", "name": "North America"}, - "SZ": {"code": "AF", "name": "Africa"}, - "SY": {"code": "AS", "name": "Asia"}, - "SX": {"code": "NA", "name": "North America"}, - "KG": {"code": "AS", "name": "Asia"}, - "KE": {"code": "AF", "name": "Africa"}, - "SS": {"code": "AF", "name": "Africa"}, - "SR": {"code": "SA", "name": "South America"}, - "KI": {"code": "OC", "name": "Oceania"}, - "KH": {"code": "AS", "name": "Asia"}, - "KN": {"code": "NA", "name": "North America"}, - "KM": {"code": "AF", "name": "Africa"}, - "ST": {"code": "AF", "name": "Africa"}, - "SK": {"code": "EU", "name": "Europe"}, - "KR": {"code": "AS", "name": "Asia"}, - "SI": {"code": "EU", "name": "Europe"}, - "KP": {"code": "AS", "name": "Asia"}, - "KW": {"code": "AS", "name": "Asia"}, - "SN": {"code": "AF", "name": "Africa"}, - "SM": {"code": "EU", "name": "Europe"}, - "SL": {"code": "AF", "name": "Africa"}, - "SC": {"code": "AF", "name": "Africa"}, - "KZ": {"code": "AS", "name": "Asia"}, - "KY": {"code": "NA", "name": "North America"}, - "SG": {"code": "AS", "name": "Asia"}, - "SE": {"code": "EU", "name": "Europe"}, - "SD": {"code": "AF", "name": "Africa"}, - "DO": {"code": "NA", "name": "North America"}, - "DM": {"code": "NA", "name": "North America"}, - "DJ": {"code": "AF", "name": "Africa"}, - "DK": {"code": "EU", "name": "Europe"}, - "VG": {"code": "NA", "name": "North America"}, - "DE": {"code": "EU", "name": "Europe"}, - "YE": {"code": "AS", "name": "Asia"}, - "DZ": {"code": "AF", "name": "Africa"}, - "US": {"code": "NA", "name": "North America"}, - "UY": {"code": "SA", "name": "South America"}, - "YT": {"code": "AF", "name": "Africa"}, - "UM": {"code": "OC", "name": "Oceania"}, - "LB": {"code": "AS", "name": "Asia"}, - "LC": {"code": "NA", "name": "North America"}, - "LA": {"code": "AS", "name": "Asia"}, - "TV": {"code": "OC", "name": "Oceania"}, - "TW": {"code": "AS", "name": "Asia"}, - "TT": {"code": "NA", "name": "North America"}, - "TR": {"code": "AS", "name": "Asia"}, - "LK": {"code": "AS", "name": "Asia"}, - "LI": {"code": "EU", "name": "Europe"}, - "LV": {"code": "EU", "name": "Europe"}, - "TO": {"code": "OC", "name": "Oceania"}, - "LT": {"code": "EU", "name": "Europe"}, - "LU": {"code": "EU", "name": "Europe"}, - "LR": {"code": "AF", "name": "Africa"}, - "LS": {"code": "AF", "name": "Africa"}, - "TH": {"code": "AS", "name": "Asia"}, - "TF": {"code": "AN", "name": "Antarctica"}, - "TG": {"code": "AF", "name": "Africa"}, - "TD": {"code": "AF", "name": "Africa"}, - "TC": {"code": "NA", "name": "North America"}, - "LY": {"code": "AF", "name": "Africa"}, - "VA": {"code": "EU", "name": "Europe"}, - "VC": {"code": "NA", "name": "North America"}, - "AE": {"code": "AS", "name": "Asia"}, - "AD": {"code": "EU", "name": "Europe"}, - "AG": {"code": "NA", "name": "North America"}, - "AF": {"code": "AS", "name": "Asia"}, - "AI": {"code": "NA", "name": "North America"}, - "VI": {"code": "NA", "name": "North America"}, - "IS": {"code": "EU", "name": "Europe"}, - "IR": {"code": "AS", "name": "Asia"}, - "AM": {"code": "AS", "name": "Asia"}, - "AL": {"code": "EU", "name": "Europe"}, - "AO": {"code": "AF", "name": "Africa"}, - "AQ": {"code": "AN", "name": "Antarctica"}, - "AS": {"code": "OC", "name": "Oceania"}, - "AR": {"code": "SA", "name": "South America"}, - "AU": {"code": "OC", "name": "Oceania"}, - "AT": {"code": "EU", "name": "Europe"}, - "AW": {"code": "NA", "name": "North America"}, - "IN": {"code": "AS", "name": "Asia"}, - "AX": {"code": "EU", "name": "Europe"}, - "AZ": {"code": "AS", "name": "Asia"}, - "IE": {"code": "EU", "name": "Europe"}, - "ID": {"code": "AS", "name": "Asia"}, - "UA": {"code": "EU", "name": "Europe"}, - "QA": {"code": "AS", "name": "Asia"}, - "MZ": {"code": "AF", "name": "Africa"} - } - - - \ No newline at end of file diff --git a/ipinfo/countries.py b/ipinfo/countries.py deleted file mode 100644 index 652aa0d..0000000 --- a/ipinfo/countries.py +++ /dev/null @@ -1,3 +0,0 @@ -# Used to transform incoming responses with country abbreviations into the full -# expanded country name, e.g. "PK" -> "Pakistan". -countries = {"BD": "Bangladesh", "BE": "Belgium", "BF": "Burkina Faso", "BG": "Bulgaria", "BA": "Bosnia and Herzegovina", "BB": "Barbados", "WF": "Wallis and Futuna", "BL": "Saint Barthelemy", "BM": "Bermuda", "BN": "Brunei", "BO": "Bolivia", "BH": "Bahrain", "BI": "Burundi", "BJ": "Benin", "BT": "Bhutan", "JM": "Jamaica", "BV": "Bouvet Island", "BW": "Botswana", "WS": "Samoa", "BQ": "Bonaire, Saint Eustatius and Saba ", "BR": "Brazil", "BS": "Bahamas", "JE": "Jersey", "BY": "Belarus", "BZ": "Belize", "RU": "Russia", "RW": "Rwanda", "RS": "Serbia", "TL": "East Timor", "RE": "Reunion", "TM": "Turkmenistan", "TJ": "Tajikistan", "RO": "Romania", "TK": "Tokelau", "GW": "Guinea-Bissau", "GU": "Guam", "GT": "Guatemala", "GS": "South Georgia and the South Sandwich Islands", "GR": "Greece", "GQ": "Equatorial Guinea", "GP": "Guadeloupe", "JP": "Japan", "GY": "Guyana", "GG": "Guernsey", "GF": "French Guiana", "GE": "Georgia", "GD": "Grenada", "GB": "United Kingdom", "GA": "Gabon", "SV": "El Salvador", "GN": "Guinea", "GM": "Gambia", "GL": "Greenland", "GI": "Gibraltar", "GH": "Ghana", "OM": "Oman", "TN": "Tunisia", "JO": "Jordan", "HR": "Croatia", "HT": "Haiti", "HU": "Hungary", "HK": "Hong Kong", "HN": "Honduras", "HM": "Heard Island and McDonald Islands", "VE": "Venezuela", "PR": "Puerto Rico", "PS": "Palestinian Territory", "PW": "Palau", "PT": "Portugal", "SJ": "Svalbard and Jan Mayen", "PY": "Paraguay", "IQ": "Iraq", "PA": "Panama", "PF": "French Polynesia", "PG": "Papua New Guinea", "PE": "Peru", "PK": "Pakistan", "PH": "Philippines", "PN": "Pitcairn", "PL": "Poland", "PM": "Saint Pierre and Miquelon", "ZM": "Zambia", "EH": "Western Sahara", "EE": "Estonia", "EG": "Egypt", "ZA": "South Africa", "EC": "Ecuador", "IT": "Italy", "VN": "Vietnam", "SB": "Solomon Islands", "ET": "Ethiopia", "SO": "Somalia", "ZW": "Zimbabwe", "SA": "Saudi Arabia", "ES": "Spain", "ER": "Eritrea", "ME": "Montenegro", "MD": "Moldova", "MG": "Madagascar", "MF": "Saint Martin", "MA": "Morocco", "MC": "Monaco", "UZ": "Uzbekistan", "MM": "Myanmar", "ML": "Mali", "MO": "Macao", "MN": "Mongolia", "MH": "Marshall Islands", "MK": "Macedonia", "MU": "Mauritius", "MT": "Malta", "MW": "Malawi", "MV": "Maldives", "MQ": "Martinique", "MP": "Northern Mariana Islands", "MS": "Montserrat", "MR": "Mauritania", "IM": "Isle of Man", "UG": "Uganda", "TZ": "Tanzania", "MY": "Malaysia", "MX": "Mexico", "IL": "Israel", "FR": "France", "IO": "British Indian Ocean Territory", "SH": "Saint Helena", "FI": "Finland", "FJ": "Fiji", "FK": "Falkland Islands", "FM": "Micronesia", "FO": "Faroe Islands", "NI": "Nicaragua", "NL": "Netherlands", "NO": "Norway", "NA": "Namibia", "VU": "Vanuatu", "NC": "New Caledonia", "NE": "Niger", "NF": "Norfolk Island", "NG": "Nigeria", "NZ": "New Zealand", "NP": "Nepal", "NR": "Nauru", "NU": "Niue", "CK": "Cook Islands", "XK": "Kosovo", "CI": "Ivory Coast", "CH": "Switzerland", "CO": "Colombia", "CN": "China", "CM": "Cameroon", "CL": "Chile", "CC": "Cocos Islands", "CA": "Canada", "CG": "Republic of the Congo", "CF": "Central African Republic", "CD": "Democratic Republic of the Congo", "CZ": "Czech Republic", "CY": "Cyprus", "CX": "Christmas Island", "CR": "Costa Rica", "CW": "Curacao", "CV": "Cape Verde", "CU": "Cuba", "SZ": "Swaziland", "SY": "Syria", "SX": "Sint Maarten", "KG": "Kyrgyzstan", "KE": "Kenya", "SS": "South Sudan", "SR": "Suriname", "KI": "Kiribati", "KH": "Cambodia", "KN": "Saint Kitts and Nevis", "KM": "Comoros", "ST": "Sao Tome and Principe", "SK": "Slovakia", "KR": "South Korea", "SI": "Slovenia", "KP": "North Korea", "KW": "Kuwait", "SN": "Senegal", "SM": "San Marino", "SL": "Sierra Leone", "SC": "Seychelles", "KZ": "Kazakhstan", "KY": "Cayman Islands", "SG": "Singapore", "SE": "Sweden", "SD": "Sudan", "DO": "Dominican Republic", "DM": "Dominica", "DJ": "Djibouti", "DK": "Denmark", "VG": "British Virgin Islands", "DE": "Germany", "YE": "Yemen", "DZ": "Algeria", "US": "United States", "UY": "Uruguay", "YT": "Mayotte", "UM": "United States Minor Outlying Islands", "LB": "Lebanon", "LC": "Saint Lucia", "LA": "Laos", "TV": "Tuvalu", "TW": "Taiwan", "TT": "Trinidad and Tobago", "TR": "Turkey", "LK": "Sri Lanka", "LI": "Liechtenstein", "LV": "Latvia", "TO": "Tonga", "LT": "Lithuania", "LU": "Luxembourg", "LR": "Liberia", "LS": "Lesotho", "TH": "Thailand", "TF": "French Southern Territories", "TG": "Togo", "TD": "Chad", "TC": "Turks and Caicos Islands", "LY": "Libya", "VA": "Vatican", "VC": "Saint Vincent and the Grenadines", "AE": "United Arab Emirates", "AD": "Andorra", "AG": "Antigua and Barbuda", "AF": "Afghanistan", "AI": "Anguilla", "VI": "U.S. Virgin Islands", "IS": "Iceland", "IR": "Iran", "AM": "Armenia", "AL": "Albania", "AO": "Angola", "AQ": "Antarctica", "AS": "American Samoa", "AR": "Argentina", "AU": "Australia", "AT": "Austria", "AW": "Aruba", "IN": "India", "AX": "Aland Islands", "AZ": "Azerbaijan", "IE": "Ireland", "ID": "Indonesia", "UA": "Ukraine", "QA": "Qatar", "MZ": "Mozambique"} diff --git a/ipinfo/currency.py b/ipinfo/currency.py deleted file mode 100644 index f910462..0000000 --- a/ipinfo/currency.py +++ /dev/null @@ -1,252 +0,0 @@ -countries_currencies = { - "AD": {"code": "EUR", "symbol": "€"}, - "AE": {"code": "AED", "symbol": "د.إ"}, - "AF": {"code": "AFN", "symbol": "؋"}, - "AG": {"code": "XCD", "symbol": "$"}, - "AI": {"code": "XCD", "symbol": "$"}, - "AL": {"code": "ALL", "symbol": "L"}, - "AM": {"code": "AMD", "symbol": "֏"}, - "AO": {"code": "AOA", "symbol": "Kz"}, - "AQ": {"code": "", "symbol": "$"}, - "AR": {"code": "ARS", "symbol": "$"}, - "AS": {"code": "USD", "symbol": "$"}, - "AT": {"code": "EUR", "symbol": "€"}, - "AU": {"code": "AUD", "symbol": "$"}, - "AW": {"code": "AWG", "symbol": "ƒ"}, - "AX": {"code": "EUR", "symbol": "€"}, - "AZ": {"code": "AZN", "symbol": "₼"}, - "BA": {"code": "BAM", "symbol": "KM"}, - "BB": {"code": "BBD", "symbol": "$"}, - "BD": {"code": "BDT", "symbol": "৳"}, - "BE": {"code": "EUR", "symbol": "€"}, - "BF": {"code": "XOF", "symbol": "CFA"}, - "BG": {"code": "BGN", "symbol": "лв"}, - "BH": {"code": "BHD", "symbol": ".د.ب"}, - "BI": {"code": "BIF", "symbol": "FBu"}, - "BJ": {"code": "XOF", "symbol": "CFA"}, - "BL": {"code": "EUR", "symbol": "€"}, - "BM": {"code": "BMD", "symbol": "$"}, - "BN": {"code": "BND", "symbol": "$"}, - "BO": {"code": "BOB", "symbol": "$b"}, - "BQ": {"code": "USD", "symbol": "$"}, - "BR": {"code": "BRL", "symbol": "R$"}, - "BS": {"code": "BSD", "symbol": "$"}, - "BT": {"code": "BTN", "symbol": "Nu."}, - "BV": {"code": "NOK", "symbol": "kr"}, - "BW": {"code": "BWP", "symbol": "P"}, - "BY": {"code": "BYR", "symbol": "Br"}, - "BZ": {"code": "BZD", "symbol": "BZ$"}, - "CA": {"code": "CAD", "symbol": "$"}, - "CC": {"code": "AUD", "symbol": "$"}, - "CD": {"code": "CDF", "symbol": "FC"}, - "CF": {"code": "XAF", "symbol": "FCFA"}, - "CG": {"code": "XAF", "symbol": "FCFA"}, - "CH": {"code": "CHF", "symbol": "CHF"}, - "CI": {"code": "XOF", "symbol": "CFA"}, - "CK": {"code": "NZD", "symbol": "$"}, - "CL": {"code": "CLP", "symbol": "$"}, - "CM": {"code": "XAF", "symbol": "FCFA"}, - "CN": {"code": "CNY", "symbol": "¥"}, - "CO": {"code": "COP", "symbol": "$"}, - "CR": {"code": "CRC", "symbol": "₡"}, - "CU": {"code": "CUP", "symbol": "₱"}, - "CV": {"code": "CVE", "symbol": "$"}, - "CW": {"code": "ANG", "symbol": "ƒ"}, - "CX": {"code": "AUD", "symbol": "$"}, - "CY": {"code": "EUR", "symbol": "€"}, - "CZ": {"code": "CZK", "symbol": "Kč"}, - "DE": {"code": "EUR", "symbol": "€"}, - "DJ": {"code": "DJF", "symbol": "Fdj"}, - "DK": {"code": "DKK", "symbol": "kr"}, - "DM": {"code": "XCD", "symbol": "$"}, - "DO": {"code": "DOP", "symbol": "RD$"}, - "DZ": {"code": "DZD", "symbol": "دج"}, - "EC": {"code": "USD", "symbol": "$"}, - "EE": {"code": "EUR", "symbol": "€"}, - "EG": {"code": "EGP", "symbol": "£"}, - "EH": {"code": "MAD", "symbol": "MAD"}, - "ER": {"code": "ERN", "symbol": "Nfk"}, - "ES": {"code": "EUR", "symbol": "€"}, - "ET": {"code": "ETB", "symbol": "Br"}, - "FI": {"code": "EUR", "symbol": "€"}, - "FJ": {"code": "FJD", "symbol": "$"}, - "FK": {"code": "FKP", "symbol": "£"}, - "FM": {"code": "USD", "symbol": "$"}, - "FO": {"code": "DKK", "symbol": "kr"}, - "FR": {"code": "EUR", "symbol": "€"}, - "GA": {"code": "XAF", "symbol": "FCFA"}, - "GB": {"code": "GBP", "symbol": "£"}, - "GD": {"code": "XCD", "symbol": "$"}, - "GE": {"code": "GEL", "symbol": "ლ"}, - "GF": {"code": "EUR", "symbol": "€"}, - "GG": {"code": "GBP", "symbol": "£"}, - "GH": {"code": "GHS", "symbol": "GH₵"}, - "GI": {"code": "GIP", "symbol": "£"}, - "GL": {"code": "DKK", "symbol": "kr"}, - "GM": {"code": "GMD", "symbol": "D"}, - "GN": {"code": "GNF", "symbol": "FG"}, - "GP": {"code": "EUR", "symbol": "€"}, - "GQ": {"code": "XAF", "symbol": "FCFA"}, - "GR": {"code": "EUR", "symbol": "€"}, - "GS": {"code": "GBP", "symbol": "£"}, - "GT": {"code": "GTQ", "symbol": "Q"}, - "GU": {"code": "USD", "symbol": "$"}, - "GW": {"code": "XOF", "symbol": "CFA"}, - "GY": {"code": "GYD", "symbol": "$"}, - "HK": {"code": "HKD", "symbol": "$"}, - "HM": {"code": "AUD", "symbol": "$"}, - "HN": {"code": "HNL", "symbol": "L"}, - "HR": {"code": "HRK", "symbol": "kn"}, - "HT": {"code": "HTG", "symbol": "G"}, - "HU": {"code": "HUF", "symbol": "Ft"}, - "ID": {"code": "IDR", "symbol": "Rp"}, - "IE": {"code": "EUR", "symbol": "€"}, - "IL": {"code": "ILS", "symbol": "₪"}, - "IM": {"code": "GBP", "symbol": "£"}, - "IN": {"code": "INR", "symbol": "₹"}, - "IO": {"code": "USD", "symbol": "$"}, - "IQ": {"code": "IQD", "symbol": "ع.د"}, - "IR": {"code": "IRR", "symbol": "﷼"}, - "IS": {"code": "ISK", "symbol": "kr"}, - "IT": {"code": "EUR", "symbol": "€"}, - "JE": {"code": "GBP", "symbol": "£"}, - "JM": {"code": "JMD", "symbol": "J$"}, - "JO": {"code": "JOD", "symbol": "JD"}, - "JP": {"code": "JPY", "symbol": "¥"}, - "KE": {"code": "KES", "symbol": "KSh"}, - "KG": {"code": "KGS", "symbol": "лв"}, - "KH": {"code": "KHR", "symbol": "៛"}, - "KI": {"code": "AUD", "symbol": "$"}, - "KM": {"code": "KMF", "symbol": "CF"}, - "KN": {"code": "XCD", "symbol": "$"}, - "KP": {"code": "KPW", "symbol": "₩"}, - "KR": {"code": "KRW", "symbol": "₩"}, - "KW": {"code": "KWD", "symbol": "KD"}, - "KY": {"code": "KYD", "symbol": "$"}, - "KZ": {"code": "KZT", "symbol": "₸"}, - "LA": {"code": "LAK", "symbol": "₭"}, - "LB": {"code": "LBP", "symbol": "£"}, - "LC": {"code": "XCD", "symbol": "$"}, - "LI": {"code": "CHF", "symbol": "CHF"}, - "LK": {"code": "LKR", "symbol": "₨"}, - "LR": {"code": "LRD", "symbol": "$"}, - "LS": {"code": "LSL", "symbol": "M"}, - "LT": {"code": "LTL", "symbol": "Lt"}, - "LU": {"code": "EUR", "symbol": "€"}, - "LV": {"code": "EUR", "symbol": "€"}, - "LY": {"code": "LYD", "symbol": "LD"}, - "MA": {"code": "MAD", "symbol": "MAD"}, - "MC": {"code": "EUR", "symbol": "€"}, - "MD": {"code": "MDL", "symbol": "lei"}, - "ME": {"code": "EUR", "symbol": "€"}, - "MF": {"code": "EUR", "symbol": "€"}, - "MG": {"code": "MGA", "symbol": "Ar"}, - "MH": {"code": "USD", "symbol": "$"}, - "MK": {"code": "MKD", "symbol": "ден"}, - "ML": {"code": "XOF", "symbol": "CFA"}, - "MM": {"code": "MMK", "symbol": "K"}, - "MN": {"code": "MNT", "symbol": "₮"}, - "MO": {"code": "MOP", "symbol": "MOP$"}, - "MP": {"code": "USD", "symbol": "$"}, - "MQ": {"code": "EUR", "symbol": "€"}, - "MR": {"code": "MRO", "symbol": "UM"}, - "MS": {"code": "XCD", "symbol": "$"}, - "MT": {"code": "EUR", "symbol": "€"}, - "MU": {"code": "MUR", "symbol": "₨"}, - "MV": {"code": "MVR", "symbol": "Rf"}, - "MW": {"code": "MWK", "symbol": "MK"}, - "MX": {"code": "MXN", "symbol": "$"}, - "MY": {"code": "MYR", "symbol": "RM"}, - "MZ": {"code": "MZN", "symbol": "MT"}, - "NA": {"code": "NAD", "symbol": "$"}, - "NC": {"code": "XPF", "symbol": "₣"}, - "NE": {"code": "XOF", "symbol": "CFA"}, - "NF": {"code": "AUD", "symbol": "$"}, - "NG": {"code": "NGN", "symbol": "₦"}, - "NI": {"code": "NIO", "symbol": "C$"}, - "NL": {"code": "EUR", "symbol": "€"}, - "NO": {"code": "NOK", "symbol": "kr"}, - "NP": {"code": "NPR", "symbol": "₨"}, - "NR": {"code": "AUD", "symbol": "$"}, - "NU": {"code": "NZD", "symbol": "$"}, - "NZ": {"code": "NZD", "symbol": "$"}, - "OM": {"code": "OMR", "symbol": "﷼"}, - "PA": {"code": "PAB", "symbol": "B/."}, - "PE": {"code": "PEN", "symbol": "S/."}, - "PF": {"code": "XPF", "symbol": "₣"}, - "PG": {"code": "PGK", "symbol": "K"}, - "PH": {"code": "PHP", "symbol": "₱"}, - "PK": {"code": "PKR", "symbol": "₨"}, - "PL": {"code": "PLN", "symbol": "zł"}, - "PM": {"code": "EUR", "symbol": "€"}, - "PN": {"code": "NZD", "symbol": "$"}, - "PR": {"code": "USD", "symbol": "$"}, - "PS": {"code": "ILS", "symbol": "₪"}, - "PT": {"code": "EUR", "symbol": "€"}, - "PW": {"code": "USD", "symbol": "$"}, - "PY": {"code": "PYG", "symbol": "Gs"}, - "QA": {"code": "QAR", "symbol": "﷼"}, - "RE": {"code": "EUR", "symbol": "€"}, - "RO": {"code": "RON", "symbol": "lei"}, - "RS": {"code": "RSD", "symbol": "Дин."}, - "RU": {"code": "RUB", "symbol": "₽"}, - "RW": {"code": "RWF", "symbol": "R₣"}, - "SA": {"code": "SAR", "symbol": "﷼"}, - "SB": {"code": "SBD", "symbol": "$"}, - "SC": {"code": "SCR", "symbol": "₨"}, - "SD": {"code": "SDG", "symbol": "ج.س."}, - "SE": {"code": "SEK", "symbol": "kr"}, - "SG": {"code": "SGD", "symbol": "S$"}, - "SH": {"code": "SHP", "symbol": "£"}, - "SI": {"code": "EUR", "symbol": "€"}, - "SJ": {"code": "NOK", "symbol": "kr"}, - "SK": {"code": "EUR", "symbol": "€"}, - "SL": {"code": "SLL", "symbol": "Le"}, - "SM": {"code": "EUR", "symbol": "€"}, - "SN": {"code": "XOF", "symbol": "CFA"}, - "SO": {"code": "SOS", "symbol": "S"}, - "SR": {"code": "SRD", "symbol": "$"}, - "SS": {"code": "SSP", "symbol": "£"}, - "ST": {"code": "STD", "symbol": "Db"}, - "SV": {"code": "USD", "symbol": "$"}, - "SX": {"code": "ANG", "symbol": "ƒ"}, - "SY": {"code": "SYP", "symbol": "£"}, - "SZ": {"code": "SZL", "symbol": "E"}, - "TC": {"code": "USD", "symbol": "$"}, - "TD": {"code": "XAF", "symbol": "FCFA"}, - "TF": {"code": "EUR", "symbol": "€"}, - "TG": {"code": "XOF", "symbol": "CFA"}, - "TH": {"code": "THB", "symbol": "฿"}, - "TJ": {"code": "TJS", "symbol": "SM"}, - "TK": {"code": "NZD", "symbol": "$"}, - "TL": {"code": "USD", "symbol": "$"}, - "TM": {"code": "TMT", "symbol": "T"}, - "TN": {"code": "TND", "symbol": "د.ت"}, - "TO": {"code": "TOP", "symbol": "T$"}, - "TR": {"code": "TRY", "symbol": "₺"}, - "TT": {"code": "TTD", "symbol": "TT$"}, - "TV": {"code": "AUD", "symbol": "$"}, - "TW": {"code": "TWD", "symbol": "NT$"}, - "TZ": {"code": "TZS", "symbol": "TSh"}, - "UA": {"code": "UAH", "symbol": "₴"}, - "UG": {"code": "UGX", "symbol": "USh"}, - "UM": {"code": "USD", "symbol": "$"}, - "US": {"code": "USD", "symbol": "$"}, - "UY": {"code": "UYU", "symbol": "$U"}, - "UZ": {"code": "UZS", "symbol": "лв"}, - "VA": {"code": "EUR", "symbol": "€"}, - "VC": {"code": "XCD", "symbol": "$"}, - "VE": {"code": "VEF", "symbol": "Bs"}, - "VG": {"code": "USD", "symbol": "$"}, - "VI": {"code": "USD", "symbol": "$"}, - "VN": {"code": "VND", "symbol": "₫"}, - "VU": {"code": "VUV", "symbol": "VT"}, - "WF": {"code": "XPF", "symbol": "₣"}, - "WS": {"code": "WST", "symbol": "WS$"}, - "XK": {"code": "EUR", "symbol": "€"}, - "YE": {"code": "YER", "symbol": "﷼"}, - "YT": {"code": "EUR", "symbol": "€"}, - "ZA": {"code": "ZAR", "symbol": "R"}, - "ZM": {"code": "ZMK", "symbol": "ZK"}, - "ZW": {"code": "ZWL", "symbol": "$"} -} diff --git a/ipinfo/data.py b/ipinfo/data.py new file mode 100644 index 0000000..21271da --- /dev/null +++ b/ipinfo/data.py @@ -0,0 +1,1042 @@ +continents = { + "BD": {"code": "AS", "name": "Asia"}, + "BE": {"code": "EU", "name": "Europe"}, + "BF": {"code": "AF", "name": "Africa"}, + "BG": {"code": "EU", "name": "Europe"}, + "BA": {"code": "EU", "name": "Europe"}, + "BB": {"code": "NA", "name": "North America"}, + "WF": {"code": "OC", "name": "Oceania"}, + "BL": {"code": "NA", "name": "North America"}, + "BM": {"code": "NA", "name": "North America"}, + "BN": {"code": "AS", "name": "Asia"}, + "BO": {"code": "SA", "name": "South America"}, + "BH": {"code": "AS", "name": "Asia"}, + "BI": {"code": "AF", "name": "Africa"}, + "BJ": {"code": "AF", "name": "Africa"}, + "BT": {"code": "AS", "name": "Asia"}, + "JM": {"code": "NA", "name": "North America"}, + "BV": {"code": "AN", "name": "Antarctica"}, + "BW": {"code": "AF", "name": "Africa"}, + "WS": {"code": "OC", "name": "Oceania"}, + "BQ": {"code": "NA", "name": "North America"}, + "BR": {"code": "SA", "name": "South America"}, + "BS": {"code": "NA", "name": "North America"}, + "JE": {"code": "EU", "name": "Europe"}, + "BY": {"code": "EU", "name": "Europe"}, + "BZ": {"code": "NA", "name": "North America"}, + "RU": {"code": "EU", "name": "Europe"}, + "RW": {"code": "AF", "name": "Africa"}, + "RS": {"code": "EU", "name": "Europe"}, + "TL": {"code": "OC", "name": "Oceania"}, + "RE": {"code": "AF", "name": "Africa"}, + "TM": {"code": "AS", "name": "Asia"}, + "TJ": {"code": "AS", "name": "Asia"}, + "RO": {"code": "EU", "name": "Europe"}, + "TK": {"code": "OC", "name": "Oceania"}, + "GW": {"code": "AF", "name": "Africa"}, + "GU": {"code": "OC", "name": "Oceania"}, + "GT": {"code": "NA", "name": "North America"}, + "GS": {"code": "AN", "name": "Antarctica"}, + "GR": {"code": "EU", "name": "Europe"}, + "GQ": {"code": "AF", "name": "Africa"}, + "GP": {"code": "NA", "name": "North America"}, + "JP": {"code": "AS", "name": "Asia"}, + "GY": {"code": "SA", "name": "South America"}, + "GG": {"code": "EU", "name": "Europe"}, + "GF": {"code": "SA", "name": "South America"}, + "GE": {"code": "AS", "name": "Asia"}, + "GD": {"code": "NA", "name": "North America"}, + "GB": {"code": "EU", "name": "Europe"}, + "GA": {"code": "AF", "name": "Africa"}, + "SV": {"code": "NA", "name": "North America"}, + "GN": {"code": "AF", "name": "Africa"}, + "GM": {"code": "AF", "name": "Africa"}, + "GL": {"code": "NA", "name": "North America"}, + "GI": {"code": "EU", "name": "Europe"}, + "GH": {"code": "AF", "name": "Africa"}, + "OM": {"code": "AS", "name": "Asia"}, + "TN": {"code": "AF", "name": "Africa"}, + "JO": {"code": "AS", "name": "Asia"}, + "HR": {"code": "EU", "name": "Europe"}, + "HT": {"code": "NA", "name": "North America"}, + "HU": {"code": "EU", "name": "Europe"}, + "HK": {"code": "AS", "name": "Asia"}, + "HN": {"code": "NA", "name": "North America"}, + "HM": {"code": "AN", "name": "Antarctica"}, + "VE": {"code": "SA", "name": "South America"}, + "PR": {"code": "NA", "name": "North America"}, + "PS": {"code": "AS", "name": "Asia"}, + "PW": {"code": "OC", "name": "Oceania"}, + "PT": {"code": "EU", "name": "Europe"}, + "SJ": {"code": "EU", "name": "Europe"}, + "PY": {"code": "SA", "name": "South America"}, + "IQ": {"code": "AS", "name": "Asia"}, + "PA": {"code": "NA", "name": "North America"}, + "PF": {"code": "OC", "name": "Oceania"}, + "PG": {"code": "OC", "name": "Oceania"}, + "PE": {"code": "SA", "name": "South America"}, + "PK": {"code": "AS", "name": "Asia"}, + "PH": {"code": "AS", "name": "Asia"}, + "PN": {"code": "OC", "name": "Oceania"}, + "PL": {"code": "EU", "name": "Europe"}, + "PM": {"code": "NA", "name": "North America"}, + "ZM": {"code": "AF", "name": "Africa"}, + "EH": {"code": "AF", "name": "Africa"}, + "EE": {"code": "EU", "name": "Europe"}, + "EG": {"code": "AF", "name": "Africa"}, + "ZA": {"code": "AF", "name": "Africa"}, + "EC": {"code": "SA", "name": "South America"}, + "IT": {"code": "EU", "name": "Europe"}, + "VN": {"code": "AS", "name": "Asia"}, + "SB": {"code": "OC", "name": "Oceania"}, + "ET": {"code": "AF", "name": "Africa"}, + "SO": {"code": "AF", "name": "Africa"}, + "ZW": {"code": "AF", "name": "Africa"}, + "SA": {"code": "AS", "name": "Asia"}, + "ES": {"code": "EU", "name": "Europe"}, + "ER": {"code": "AF", "name": "Africa"}, + "ME": {"code": "EU", "name": "Europe"}, + "MD": {"code": "EU", "name": "Europe"}, + "MG": {"code": "AF", "name": "Africa"}, + "MF": {"code": "NA", "name": "North America"}, + "MA": {"code": "AF", "name": "Africa"}, + "MC": {"code": "EU", "name": "Europe"}, + "UZ": {"code": "AS", "name": "Asia"}, + "MM": {"code": "AS", "name": "Asia"}, + "ML": {"code": "AF", "name": "Africa"}, + "MO": {"code": "AS", "name": "Asia"}, + "MN": {"code": "AS", "name": "Asia"}, + "MH": {"code": "OC", "name": "Oceania"}, + "MK": {"code": "EU", "name": "Europe"}, + "MU": {"code": "AF", "name": "Africa"}, + "MT": {"code": "EU", "name": "Europe"}, + "MW": {"code": "AF", "name": "Africa"}, + "MV": {"code": "AS", "name": "Asia"}, + "MQ": {"code": "NA", "name": "North America"}, + "MP": {"code": "OC", "name": "Oceania"}, + "MS": {"code": "NA", "name": "North America"}, + "MR": {"code": "AF", "name": "Africa"}, + "IM": {"code": "EU", "name": "Europe"}, + "UG": {"code": "AF", "name": "Africa"}, + "TZ": {"code": "AF", "name": "Africa"}, + "MY": {"code": "AS", "name": "Asia"}, + "MX": {"code": "NA", "name": "North America"}, + "IL": {"code": "AS", "name": "Asia"}, + "FR": {"code": "EU", "name": "Europe"}, + "IO": {"code": "AS", "name": "Asia"}, + "SH": {"code": "AF", "name": "Africa"}, + "FI": {"code": "EU", "name": "Europe"}, + "FJ": {"code": "OC", "name": "Oceania"}, + "FK": {"code": "SA", "name": "South America"}, + "FM": {"code": "OC", "name": "Oceania"}, + "FO": {"code": "EU", "name": "Europe"}, + "NI": {"code": "NA", "name": "North America"}, + "NL": {"code": "EU", "name": "Europe"}, + "NO": {"code": "EU", "name": "Europe"}, + "NA": {"code": "AF", "name": "Africa"}, + "VU": {"code": "OC", "name": "Oceania"}, + "NC": {"code": "OC", "name": "Oceania"}, + "NE": {"code": "AF", "name": "Africa"}, + "NF": {"code": "OC", "name": "Oceania"}, + "NG": {"code": "AF", "name": "Africa"}, + "NZ": {"code": "OC", "name": "Oceania"}, + "NP": {"code": "AS", "name": "Asia"}, + "NR": {"code": "OC", "name": "Oceania"}, + "NU": {"code": "OC", "name": "Oceania"}, + "CK": {"code": "OC", "name": "Oceania"}, + "XK": {"code": "EU", "name": "Europe"}, + "CI": {"code": "AF", "name": "Africa"}, + "CH": {"code": "EU", "name": "Europe"}, + "CO": {"code": "SA", "name": "South America"}, + "CN": {"code": "AS", "name": "Asia"}, + "CM": {"code": "AF", "name": "Africa"}, + "CL": {"code": "SA", "name": "South America"}, + "CC": {"code": "AS", "name": "Asia"}, + "CA": {"code": "NA", "name": "North America"}, + "CG": {"code": "AF", "name": "Africa"}, + "CF": {"code": "AF", "name": "Africa"}, + "CD": {"code": "AF", "name": "Africa"}, + "CZ": {"code": "EU", "name": "Europe"}, + "CY": {"code": "EU", "name": "Europe"}, + "CX": {"code": "AS", "name": "Asia"}, + "CR": {"code": "NA", "name": "North America"}, + "CW": {"code": "NA", "name": "North America"}, + "CV": {"code": "AF", "name": "Africa"}, + "CU": {"code": "NA", "name": "North America"}, + "SZ": {"code": "AF", "name": "Africa"}, + "SY": {"code": "AS", "name": "Asia"}, + "SX": {"code": "NA", "name": "North America"}, + "KG": {"code": "AS", "name": "Asia"}, + "KE": {"code": "AF", "name": "Africa"}, + "SS": {"code": "AF", "name": "Africa"}, + "SR": {"code": "SA", "name": "South America"}, + "KI": {"code": "OC", "name": "Oceania"}, + "KH": {"code": "AS", "name": "Asia"}, + "KN": {"code": "NA", "name": "North America"}, + "KM": {"code": "AF", "name": "Africa"}, + "ST": {"code": "AF", "name": "Africa"}, + "SK": {"code": "EU", "name": "Europe"}, + "KR": {"code": "AS", "name": "Asia"}, + "SI": {"code": "EU", "name": "Europe"}, + "KP": {"code": "AS", "name": "Asia"}, + "KW": {"code": "AS", "name": "Asia"}, + "SN": {"code": "AF", "name": "Africa"}, + "SM": {"code": "EU", "name": "Europe"}, + "SL": {"code": "AF", "name": "Africa"}, + "SC": {"code": "AF", "name": "Africa"}, + "KZ": {"code": "AS", "name": "Asia"}, + "KY": {"code": "NA", "name": "North America"}, + "SG": {"code": "AS", "name": "Asia"}, + "SE": {"code": "EU", "name": "Europe"}, + "SD": {"code": "AF", "name": "Africa"}, + "DO": {"code": "NA", "name": "North America"}, + "DM": {"code": "NA", "name": "North America"}, + "DJ": {"code": "AF", "name": "Africa"}, + "DK": {"code": "EU", "name": "Europe"}, + "VG": {"code": "NA", "name": "North America"}, + "DE": {"code": "EU", "name": "Europe"}, + "YE": {"code": "AS", "name": "Asia"}, + "DZ": {"code": "AF", "name": "Africa"}, + "US": {"code": "NA", "name": "North America"}, + "UY": {"code": "SA", "name": "South America"}, + "YT": {"code": "AF", "name": "Africa"}, + "UM": {"code": "OC", "name": "Oceania"}, + "LB": {"code": "AS", "name": "Asia"}, + "LC": {"code": "NA", "name": "North America"}, + "LA": {"code": "AS", "name": "Asia"}, + "TV": {"code": "OC", "name": "Oceania"}, + "TW": {"code": "AS", "name": "Asia"}, + "TT": {"code": "NA", "name": "North America"}, + "TR": {"code": "AS", "name": "Asia"}, + "LK": {"code": "AS", "name": "Asia"}, + "LI": {"code": "EU", "name": "Europe"}, + "LV": {"code": "EU", "name": "Europe"}, + "TO": {"code": "OC", "name": "Oceania"}, + "LT": {"code": "EU", "name": "Europe"}, + "LU": {"code": "EU", "name": "Europe"}, + "LR": {"code": "AF", "name": "Africa"}, + "LS": {"code": "AF", "name": "Africa"}, + "TH": {"code": "AS", "name": "Asia"}, + "TF": {"code": "AN", "name": "Antarctica"}, + "TG": {"code": "AF", "name": "Africa"}, + "TD": {"code": "AF", "name": "Africa"}, + "TC": {"code": "NA", "name": "North America"}, + "LY": {"code": "AF", "name": "Africa"}, + "VA": {"code": "EU", "name": "Europe"}, + "VC": {"code": "NA", "name": "North America"}, + "AE": {"code": "AS", "name": "Asia"}, + "AD": {"code": "EU", "name": "Europe"}, + "AG": {"code": "NA", "name": "North America"}, + "AF": {"code": "AS", "name": "Asia"}, + "AI": {"code": "NA", "name": "North America"}, + "VI": {"code": "NA", "name": "North America"}, + "IS": {"code": "EU", "name": "Europe"}, + "IR": {"code": "AS", "name": "Asia"}, + "AM": {"code": "AS", "name": "Asia"}, + "AL": {"code": "EU", "name": "Europe"}, + "AO": {"code": "AF", "name": "Africa"}, + "AQ": {"code": "AN", "name": "Antarctica"}, + "AS": {"code": "OC", "name": "Oceania"}, + "AR": {"code": "SA", "name": "South America"}, + "AU": {"code": "OC", "name": "Oceania"}, + "AT": {"code": "EU", "name": "Europe"}, + "AW": {"code": "NA", "name": "North America"}, + "IN": {"code": "AS", "name": "Asia"}, + "AX": {"code": "EU", "name": "Europe"}, + "AZ": {"code": "AS", "name": "Asia"}, + "IE": {"code": "EU", "name": "Europe"}, + "ID": {"code": "AS", "name": "Asia"}, + "UA": {"code": "EU", "name": "Europe"}, + "QA": {"code": "AS", "name": "Asia"}, + "MZ": {"code": "AF", "name": "Africa"}, +} + +# Used to transform incoming responses with country abbreviations into the full +# expanded country name, e.g. "PK" -> "Pakistan". +countries = { + "BD": "Bangladesh", + "BE": "Belgium", + "BF": "Burkina Faso", + "BG": "Bulgaria", + "BA": "Bosnia and Herzegovina", + "BB": "Barbados", + "WF": "Wallis and Futuna", + "BL": "Saint Barthelemy", + "BM": "Bermuda", + "BN": "Brunei", + "BO": "Bolivia", + "BH": "Bahrain", + "BI": "Burundi", + "BJ": "Benin", + "BT": "Bhutan", + "JM": "Jamaica", + "BV": "Bouvet Island", + "BW": "Botswana", + "WS": "Samoa", + "BQ": "Bonaire, Saint Eustatius and Saba ", + "BR": "Brazil", + "BS": "Bahamas", + "JE": "Jersey", + "BY": "Belarus", + "BZ": "Belize", + "RU": "Russia", + "RW": "Rwanda", + "RS": "Serbia", + "TL": "East Timor", + "RE": "Reunion", + "TM": "Turkmenistan", + "TJ": "Tajikistan", + "RO": "Romania", + "TK": "Tokelau", + "GW": "Guinea-Bissau", + "GU": "Guam", + "GT": "Guatemala", + "GS": "South Georgia and the South Sandwich Islands", + "GR": "Greece", + "GQ": "Equatorial Guinea", + "GP": "Guadeloupe", + "JP": "Japan", + "GY": "Guyana", + "GG": "Guernsey", + "GF": "French Guiana", + "GE": "Georgia", + "GD": "Grenada", + "GB": "United Kingdom", + "GA": "Gabon", + "SV": "El Salvador", + "GN": "Guinea", + "GM": "Gambia", + "GL": "Greenland", + "GI": "Gibraltar", + "GH": "Ghana", + "OM": "Oman", + "TN": "Tunisia", + "JO": "Jordan", + "HR": "Croatia", + "HT": "Haiti", + "HU": "Hungary", + "HK": "Hong Kong", + "HN": "Honduras", + "HM": "Heard Island and McDonald Islands", + "VE": "Venezuela", + "PR": "Puerto Rico", + "PS": "Palestinian Territory", + "PW": "Palau", + "PT": "Portugal", + "SJ": "Svalbard and Jan Mayen", + "PY": "Paraguay", + "IQ": "Iraq", + "PA": "Panama", + "PF": "French Polynesia", + "PG": "Papua New Guinea", + "PE": "Peru", + "PK": "Pakistan", + "PH": "Philippines", + "PN": "Pitcairn", + "PL": "Poland", + "PM": "Saint Pierre and Miquelon", + "ZM": "Zambia", + "EH": "Western Sahara", + "EE": "Estonia", + "EG": "Egypt", + "ZA": "South Africa", + "EC": "Ecuador", + "IT": "Italy", + "VN": "Vietnam", + "SB": "Solomon Islands", + "ET": "Ethiopia", + "SO": "Somalia", + "ZW": "Zimbabwe", + "SA": "Saudi Arabia", + "ES": "Spain", + "ER": "Eritrea", + "ME": "Montenegro", + "MD": "Moldova", + "MG": "Madagascar", + "MF": "Saint Martin", + "MA": "Morocco", + "MC": "Monaco", + "UZ": "Uzbekistan", + "MM": "Myanmar", + "ML": "Mali", + "MO": "Macao", + "MN": "Mongolia", + "MH": "Marshall Islands", + "MK": "Macedonia", + "MU": "Mauritius", + "MT": "Malta", + "MW": "Malawi", + "MV": "Maldives", + "MQ": "Martinique", + "MP": "Northern Mariana Islands", + "MS": "Montserrat", + "MR": "Mauritania", + "IM": "Isle of Man", + "UG": "Uganda", + "TZ": "Tanzania", + "MY": "Malaysia", + "MX": "Mexico", + "IL": "Israel", + "FR": "France", + "IO": "British Indian Ocean Territory", + "SH": "Saint Helena", + "FI": "Finland", + "FJ": "Fiji", + "FK": "Falkland Islands", + "FM": "Micronesia", + "FO": "Faroe Islands", + "NI": "Nicaragua", + "NL": "Netherlands", + "NO": "Norway", + "NA": "Namibia", + "VU": "Vanuatu", + "NC": "New Caledonia", + "NE": "Niger", + "NF": "Norfolk Island", + "NG": "Nigeria", + "NZ": "New Zealand", + "NP": "Nepal", + "NR": "Nauru", + "NU": "Niue", + "CK": "Cook Islands", + "XK": "Kosovo", + "CI": "Ivory Coast", + "CH": "Switzerland", + "CO": "Colombia", + "CN": "China", + "CM": "Cameroon", + "CL": "Chile", + "CC": "Cocos Islands", + "CA": "Canada", + "CG": "Republic of the Congo", + "CF": "Central African Republic", + "CD": "Democratic Republic of the Congo", + "CZ": "Czech Republic", + "CY": "Cyprus", + "CX": "Christmas Island", + "CR": "Costa Rica", + "CW": "Curacao", + "CV": "Cape Verde", + "CU": "Cuba", + "SZ": "Swaziland", + "SY": "Syria", + "SX": "Sint Maarten", + "KG": "Kyrgyzstan", + "KE": "Kenya", + "SS": "South Sudan", + "SR": "Suriname", + "KI": "Kiribati", + "KH": "Cambodia", + "KN": "Saint Kitts and Nevis", + "KM": "Comoros", + "ST": "Sao Tome and Principe", + "SK": "Slovakia", + "KR": "South Korea", + "SI": "Slovenia", + "KP": "North Korea", + "KW": "Kuwait", + "SN": "Senegal", + "SM": "San Marino", + "SL": "Sierra Leone", + "SC": "Seychelles", + "KZ": "Kazakhstan", + "KY": "Cayman Islands", + "SG": "Singapore", + "SE": "Sweden", + "SD": "Sudan", + "DO": "Dominican Republic", + "DM": "Dominica", + "DJ": "Djibouti", + "DK": "Denmark", + "VG": "British Virgin Islands", + "DE": "Germany", + "YE": "Yemen", + "DZ": "Algeria", + "US": "United States", + "UY": "Uruguay", + "YT": "Mayotte", + "UM": "United States Minor Outlying Islands", + "LB": "Lebanon", + "LC": "Saint Lucia", + "LA": "Laos", + "TV": "Tuvalu", + "TW": "Taiwan", + "TT": "Trinidad and Tobago", + "TR": "Turkey", + "LK": "Sri Lanka", + "LI": "Liechtenstein", + "LV": "Latvia", + "TO": "Tonga", + "LT": "Lithuania", + "LU": "Luxembourg", + "LR": "Liberia", + "LS": "Lesotho", + "TH": "Thailand", + "TF": "French Southern Territories", + "TG": "Togo", + "TD": "Chad", + "TC": "Turks and Caicos Islands", + "LY": "Libya", + "VA": "Vatican", + "VC": "Saint Vincent and the Grenadines", + "AE": "United Arab Emirates", + "AD": "Andorra", + "AG": "Antigua and Barbuda", + "AF": "Afghanistan", + "AI": "Anguilla", + "VI": "U.S. Virgin Islands", + "IS": "Iceland", + "IR": "Iran", + "AM": "Armenia", + "AL": "Albania", + "AO": "Angola", + "AQ": "Antarctica", + "AS": "American Samoa", + "AR": "Argentina", + "AU": "Australia", + "AT": "Austria", + "AW": "Aruba", + "IN": "India", + "AX": "Aland Islands", + "AZ": "Azerbaijan", + "IE": "Ireland", + "ID": "Indonesia", + "UA": "Ukraine", + "QA": "Qatar", + "MZ": "Mozambique", +} + +countries_currencies = { + "AD": {"code": "EUR", "symbol": "€"}, + "AE": {"code": "AED", "symbol": "د.إ"}, + "AF": {"code": "AFN", "symbol": "؋"}, + "AG": {"code": "XCD", "symbol": "$"}, + "AI": {"code": "XCD", "symbol": "$"}, + "AL": {"code": "ALL", "symbol": "L"}, + "AM": {"code": "AMD", "symbol": "֏"}, + "AO": {"code": "AOA", "symbol": "Kz"}, + "AQ": {"code": "", "symbol": "$"}, + "AR": {"code": "ARS", "symbol": "$"}, + "AS": {"code": "USD", "symbol": "$"}, + "AT": {"code": "EUR", "symbol": "€"}, + "AU": {"code": "AUD", "symbol": "$"}, + "AW": {"code": "AWG", "symbol": "ƒ"}, + "AX": {"code": "EUR", "symbol": "€"}, + "AZ": {"code": "AZN", "symbol": "₼"}, + "BA": {"code": "BAM", "symbol": "KM"}, + "BB": {"code": "BBD", "symbol": "$"}, + "BD": {"code": "BDT", "symbol": "৳"}, + "BE": {"code": "EUR", "symbol": "€"}, + "BF": {"code": "XOF", "symbol": "CFA"}, + "BG": {"code": "BGN", "symbol": "лв"}, + "BH": {"code": "BHD", "symbol": ".د.ب"}, + "BI": {"code": "BIF", "symbol": "FBu"}, + "BJ": {"code": "XOF", "symbol": "CFA"}, + "BL": {"code": "EUR", "symbol": "€"}, + "BM": {"code": "BMD", "symbol": "$"}, + "BN": {"code": "BND", "symbol": "$"}, + "BO": {"code": "BOB", "symbol": "$b"}, + "BQ": {"code": "USD", "symbol": "$"}, + "BR": {"code": "BRL", "symbol": "R$"}, + "BS": {"code": "BSD", "symbol": "$"}, + "BT": {"code": "BTN", "symbol": "Nu."}, + "BV": {"code": "NOK", "symbol": "kr"}, + "BW": {"code": "BWP", "symbol": "P"}, + "BY": {"code": "BYR", "symbol": "Br"}, + "BZ": {"code": "BZD", "symbol": "BZ$"}, + "CA": {"code": "CAD", "symbol": "$"}, + "CC": {"code": "AUD", "symbol": "$"}, + "CD": {"code": "CDF", "symbol": "FC"}, + "CF": {"code": "XAF", "symbol": "FCFA"}, + "CG": {"code": "XAF", "symbol": "FCFA"}, + "CH": {"code": "CHF", "symbol": "CHF"}, + "CI": {"code": "XOF", "symbol": "CFA"}, + "CK": {"code": "NZD", "symbol": "$"}, + "CL": {"code": "CLP", "symbol": "$"}, + "CM": {"code": "XAF", "symbol": "FCFA"}, + "CN": {"code": "CNY", "symbol": "¥"}, + "CO": {"code": "COP", "symbol": "$"}, + "CR": {"code": "CRC", "symbol": "₡"}, + "CU": {"code": "CUP", "symbol": "₱"}, + "CV": {"code": "CVE", "symbol": "$"}, + "CW": {"code": "ANG", "symbol": "ƒ"}, + "CX": {"code": "AUD", "symbol": "$"}, + "CY": {"code": "EUR", "symbol": "€"}, + "CZ": {"code": "CZK", "symbol": "Kč"}, + "DE": {"code": "EUR", "symbol": "€"}, + "DJ": {"code": "DJF", "symbol": "Fdj"}, + "DK": {"code": "DKK", "symbol": "kr"}, + "DM": {"code": "XCD", "symbol": "$"}, + "DO": {"code": "DOP", "symbol": "RD$"}, + "DZ": {"code": "DZD", "symbol": "دج"}, + "EC": {"code": "USD", "symbol": "$"}, + "EE": {"code": "EUR", "symbol": "€"}, + "EG": {"code": "EGP", "symbol": "£"}, + "EH": {"code": "MAD", "symbol": "MAD"}, + "ER": {"code": "ERN", "symbol": "Nfk"}, + "ES": {"code": "EUR", "symbol": "€"}, + "ET": {"code": "ETB", "symbol": "Br"}, + "FI": {"code": "EUR", "symbol": "€"}, + "FJ": {"code": "FJD", "symbol": "$"}, + "FK": {"code": "FKP", "symbol": "£"}, + "FM": {"code": "USD", "symbol": "$"}, + "FO": {"code": "DKK", "symbol": "kr"}, + "FR": {"code": "EUR", "symbol": "€"}, + "GA": {"code": "XAF", "symbol": "FCFA"}, + "GB": {"code": "GBP", "symbol": "£"}, + "GD": {"code": "XCD", "symbol": "$"}, + "GE": {"code": "GEL", "symbol": "ლ"}, + "GF": {"code": "EUR", "symbol": "€"}, + "GG": {"code": "GBP", "symbol": "£"}, + "GH": {"code": "GHS", "symbol": "GH₵"}, + "GI": {"code": "GIP", "symbol": "£"}, + "GL": {"code": "DKK", "symbol": "kr"}, + "GM": {"code": "GMD", "symbol": "D"}, + "GN": {"code": "GNF", "symbol": "FG"}, + "GP": {"code": "EUR", "symbol": "€"}, + "GQ": {"code": "XAF", "symbol": "FCFA"}, + "GR": {"code": "EUR", "symbol": "€"}, + "GS": {"code": "GBP", "symbol": "£"}, + "GT": {"code": "GTQ", "symbol": "Q"}, + "GU": {"code": "USD", "symbol": "$"}, + "GW": {"code": "XOF", "symbol": "CFA"}, + "GY": {"code": "GYD", "symbol": "$"}, + "HK": {"code": "HKD", "symbol": "$"}, + "HM": {"code": "AUD", "symbol": "$"}, + "HN": {"code": "HNL", "symbol": "L"}, + "HR": {"code": "HRK", "symbol": "kn"}, + "HT": {"code": "HTG", "symbol": "G"}, + "HU": {"code": "HUF", "symbol": "Ft"}, + "ID": {"code": "IDR", "symbol": "Rp"}, + "IE": {"code": "EUR", "symbol": "€"}, + "IL": {"code": "ILS", "symbol": "₪"}, + "IM": {"code": "GBP", "symbol": "£"}, + "IN": {"code": "INR", "symbol": "₹"}, + "IO": {"code": "USD", "symbol": "$"}, + "IQ": {"code": "IQD", "symbol": "ع.د"}, + "IR": {"code": "IRR", "symbol": "﷼"}, + "IS": {"code": "ISK", "symbol": "kr"}, + "IT": {"code": "EUR", "symbol": "€"}, + "JE": {"code": "GBP", "symbol": "£"}, + "JM": {"code": "JMD", "symbol": "J$"}, + "JO": {"code": "JOD", "symbol": "JD"}, + "JP": {"code": "JPY", "symbol": "¥"}, + "KE": {"code": "KES", "symbol": "KSh"}, + "KG": {"code": "KGS", "symbol": "лв"}, + "KH": {"code": "KHR", "symbol": "៛"}, + "KI": {"code": "AUD", "symbol": "$"}, + "KM": {"code": "KMF", "symbol": "CF"}, + "KN": {"code": "XCD", "symbol": "$"}, + "KP": {"code": "KPW", "symbol": "₩"}, + "KR": {"code": "KRW", "symbol": "₩"}, + "KW": {"code": "KWD", "symbol": "KD"}, + "KY": {"code": "KYD", "symbol": "$"}, + "KZ": {"code": "KZT", "symbol": "₸"}, + "LA": {"code": "LAK", "symbol": "₭"}, + "LB": {"code": "LBP", "symbol": "£"}, + "LC": {"code": "XCD", "symbol": "$"}, + "LI": {"code": "CHF", "symbol": "CHF"}, + "LK": {"code": "LKR", "symbol": "₨"}, + "LR": {"code": "LRD", "symbol": "$"}, + "LS": {"code": "LSL", "symbol": "M"}, + "LT": {"code": "LTL", "symbol": "Lt"}, + "LU": {"code": "EUR", "symbol": "€"}, + "LV": {"code": "EUR", "symbol": "€"}, + "LY": {"code": "LYD", "symbol": "LD"}, + "MA": {"code": "MAD", "symbol": "MAD"}, + "MC": {"code": "EUR", "symbol": "€"}, + "MD": {"code": "MDL", "symbol": "lei"}, + "ME": {"code": "EUR", "symbol": "€"}, + "MF": {"code": "EUR", "symbol": "€"}, + "MG": {"code": "MGA", "symbol": "Ar"}, + "MH": {"code": "USD", "symbol": "$"}, + "MK": {"code": "MKD", "symbol": "ден"}, + "ML": {"code": "XOF", "symbol": "CFA"}, + "MM": {"code": "MMK", "symbol": "K"}, + "MN": {"code": "MNT", "symbol": "₮"}, + "MO": {"code": "MOP", "symbol": "MOP$"}, + "MP": {"code": "USD", "symbol": "$"}, + "MQ": {"code": "EUR", "symbol": "€"}, + "MR": {"code": "MRO", "symbol": "UM"}, + "MS": {"code": "XCD", "symbol": "$"}, + "MT": {"code": "EUR", "symbol": "€"}, + "MU": {"code": "MUR", "symbol": "₨"}, + "MV": {"code": "MVR", "symbol": "Rf"}, + "MW": {"code": "MWK", "symbol": "MK"}, + "MX": {"code": "MXN", "symbol": "$"}, + "MY": {"code": "MYR", "symbol": "RM"}, + "MZ": {"code": "MZN", "symbol": "MT"}, + "NA": {"code": "NAD", "symbol": "$"}, + "NC": {"code": "XPF", "symbol": "₣"}, + "NE": {"code": "XOF", "symbol": "CFA"}, + "NF": {"code": "AUD", "symbol": "$"}, + "NG": {"code": "NGN", "symbol": "₦"}, + "NI": {"code": "NIO", "symbol": "C$"}, + "NL": {"code": "EUR", "symbol": "€"}, + "NO": {"code": "NOK", "symbol": "kr"}, + "NP": {"code": "NPR", "symbol": "₨"}, + "NR": {"code": "AUD", "symbol": "$"}, + "NU": {"code": "NZD", "symbol": "$"}, + "NZ": {"code": "NZD", "symbol": "$"}, + "OM": {"code": "OMR", "symbol": "﷼"}, + "PA": {"code": "PAB", "symbol": "B/."}, + "PE": {"code": "PEN", "symbol": "S/."}, + "PF": {"code": "XPF", "symbol": "₣"}, + "PG": {"code": "PGK", "symbol": "K"}, + "PH": {"code": "PHP", "symbol": "₱"}, + "PK": {"code": "PKR", "symbol": "₨"}, + "PL": {"code": "PLN", "symbol": "zł"}, + "PM": {"code": "EUR", "symbol": "€"}, + "PN": {"code": "NZD", "symbol": "$"}, + "PR": {"code": "USD", "symbol": "$"}, + "PS": {"code": "ILS", "symbol": "₪"}, + "PT": {"code": "EUR", "symbol": "€"}, + "PW": {"code": "USD", "symbol": "$"}, + "PY": {"code": "PYG", "symbol": "Gs"}, + "QA": {"code": "QAR", "symbol": "﷼"}, + "RE": {"code": "EUR", "symbol": "€"}, + "RO": {"code": "RON", "symbol": "lei"}, + "RS": {"code": "RSD", "symbol": "Дин."}, + "RU": {"code": "RUB", "symbol": "₽"}, + "RW": {"code": "RWF", "symbol": "R₣"}, + "SA": {"code": "SAR", "symbol": "﷼"}, + "SB": {"code": "SBD", "symbol": "$"}, + "SC": {"code": "SCR", "symbol": "₨"}, + "SD": {"code": "SDG", "symbol": "ج.س."}, + "SE": {"code": "SEK", "symbol": "kr"}, + "SG": {"code": "SGD", "symbol": "S$"}, + "SH": {"code": "SHP", "symbol": "£"}, + "SI": {"code": "EUR", "symbol": "€"}, + "SJ": {"code": "NOK", "symbol": "kr"}, + "SK": {"code": "EUR", "symbol": "€"}, + "SL": {"code": "SLL", "symbol": "Le"}, + "SM": {"code": "EUR", "symbol": "€"}, + "SN": {"code": "XOF", "symbol": "CFA"}, + "SO": {"code": "SOS", "symbol": "S"}, + "SR": {"code": "SRD", "symbol": "$"}, + "SS": {"code": "SSP", "symbol": "£"}, + "ST": {"code": "STD", "symbol": "Db"}, + "SV": {"code": "USD", "symbol": "$"}, + "SX": {"code": "ANG", "symbol": "ƒ"}, + "SY": {"code": "SYP", "symbol": "£"}, + "SZ": {"code": "SZL", "symbol": "E"}, + "TC": {"code": "USD", "symbol": "$"}, + "TD": {"code": "XAF", "symbol": "FCFA"}, + "TF": {"code": "EUR", "symbol": "€"}, + "TG": {"code": "XOF", "symbol": "CFA"}, + "TH": {"code": "THB", "symbol": "฿"}, + "TJ": {"code": "TJS", "symbol": "SM"}, + "TK": {"code": "NZD", "symbol": "$"}, + "TL": {"code": "USD", "symbol": "$"}, + "TM": {"code": "TMT", "symbol": "T"}, + "TN": {"code": "TND", "symbol": "د.ت"}, + "TO": {"code": "TOP", "symbol": "T$"}, + "TR": {"code": "TRY", "symbol": "₺"}, + "TT": {"code": "TTD", "symbol": "TT$"}, + "TV": {"code": "AUD", "symbol": "$"}, + "TW": {"code": "TWD", "symbol": "NT$"}, + "TZ": {"code": "TZS", "symbol": "TSh"}, + "UA": {"code": "UAH", "symbol": "₴"}, + "UG": {"code": "UGX", "symbol": "USh"}, + "UM": {"code": "USD", "symbol": "$"}, + "US": {"code": "USD", "symbol": "$"}, + "UY": {"code": "UYU", "symbol": "$U"}, + "UZ": {"code": "UZS", "symbol": "лв"}, + "VA": {"code": "EUR", "symbol": "€"}, + "VC": {"code": "XCD", "symbol": "$"}, + "VE": {"code": "VEF", "symbol": "Bs"}, + "VG": {"code": "USD", "symbol": "$"}, + "VI": {"code": "USD", "symbol": "$"}, + "VN": {"code": "VND", "symbol": "₫"}, + "VU": {"code": "VUV", "symbol": "VT"}, + "WF": {"code": "XPF", "symbol": "₣"}, + "WS": {"code": "WST", "symbol": "WS$"}, + "XK": {"code": "EUR", "symbol": "€"}, + "YE": {"code": "YER", "symbol": "﷼"}, + "YT": {"code": "EUR", "symbol": "€"}, + "ZA": {"code": "ZAR", "symbol": "R"}, + "ZM": {"code": "ZMK", "symbol": "ZK"}, + "ZW": {"code": "ZWL", "symbol": "$"}, +} + +eu_countries = [ + "IE", + "AT", + "LT", + "LU", + "LV", + "DE", + "DK", + "SE", + "SI", + "SK", + "CZ", + "CY", + "NL", + "FI", + "FR", + "MT", + "ES", + "IT", + "EE", + "PL", + "PT", + "HU", + "HR", + "GR", + "RO", + "BG", + "BE", +] +countries_flags = { + "AD": {"emoji": "🇦🇩", "unicode": "U+1F1E6 U+1F1E9"}, + "AE": {"emoji": "🇦🇪", "unicode": "U+1F1E6 U+1F1EA"}, + "AF": {"emoji": "🇦🇫", "unicode": "U+1F1E6 U+1F1EB"}, + "AG": {"emoji": "🇦🇬", "unicode": "U+1F1E6 U+1F1EC"}, + "AI": {"emoji": "🇦🇮", "unicode": "U+1F1E6 U+1F1EE"}, + "AL": {"emoji": "🇦🇱", "unicode": "U+1F1E6 U+1F1F1"}, + "AM": {"emoji": "🇦🇲", "unicode": "U+1F1E6 U+1F1F2"}, + "AO": {"emoji": "🇦🇴", "unicode": "U+1F1E6 U+1F1F4"}, + "AQ": {"emoji": "🇦🇶", "unicode": "U+1F1E6 U+1F1F6"}, + "AR": {"emoji": "🇦🇷", "unicode": "U+1F1E6 U+1F1F7"}, + "AS": {"emoji": "🇦🇸", "unicode": "U+1F1E6 U+1F1F8"}, + "AT": {"emoji": "🇦🇹", "unicode": "U+1F1E6 U+1F1F9"}, + "AU": {"emoji": "🇦🇺", "unicode": "U+1F1E6 U+1F1FA"}, + "AW": {"emoji": "🇦🇼", "unicode": "U+1F1E6 U+1F1FC"}, + "AX": {"emoji": "🇦🇽", "unicode": "U+1F1E6 U+1F1FD"}, + "AZ": {"emoji": "🇦🇿", "unicode": "U+1F1E6 U+1F1FF"}, + "BA": {"emoji": "🇧🇦", "unicode": "U+1F1E7 U+1F1E6"}, + "BB": {"emoji": "🇧🇧", "unicode": "U+1F1E7 U+1F1E7"}, + "BD": {"emoji": "🇧🇩", "unicode": "U+1F1E7 U+1F1E9"}, + "BE": {"emoji": "🇧🇪", "unicode": "U+1F1E7 U+1F1EA"}, + "BF": {"emoji": "🇧🇫", "unicode": "U+1F1E7 U+1F1EB"}, + "BG": {"emoji": "🇧🇬", "unicode": "U+1F1E7 U+1F1EC"}, + "BH": {"emoji": "🇧🇭", "unicode": "U+1F1E7 U+1F1ED"}, + "BI": {"emoji": "🇧🇮", "unicode": "U+1F1E7 U+1F1EE"}, + "BJ": {"emoji": "🇧🇯", "unicode": "U+1F1E7 U+1F1EF"}, + "BL": {"emoji": "🇧🇱", "unicode": "U+1F1E7 U+1F1F1"}, + "BM": {"emoji": "🇧🇲", "unicode": "U+1F1E7 U+1F1F2"}, + "BN": {"emoji": "🇧🇳", "unicode": "U+1F1E7 U+1F1F3"}, + "BO": {"emoji": "🇧🇴", "unicode": "U+1F1E7 U+1F1F4"}, + "BQ": {"emoji": "🇧🇶", "unicode": "U+1F1E7 U+1F1F6"}, + "BR": {"emoji": "🇧🇷", "unicode": "U+1F1E7 U+1F1F7"}, + "BS": {"emoji": "🇧🇸", "unicode": "U+1F1E7 U+1F1F8"}, + "BT": {"emoji": "🇧🇹", "unicode": "U+1F1E7 U+1F1F9"}, + "BV": {"emoji": "🇧🇻", "unicode": "U+1F1E7 U+1F1FB"}, + "BW": {"emoji": "🇧🇼", "unicode": "U+1F1E7 U+1F1FC"}, + "BY": {"emoji": "🇧🇾", "unicode": "U+1F1E7 U+1F1FE"}, + "BZ": {"emoji": "🇧🇿", "unicode": "U+1F1E7 U+1F1FF"}, + "CA": {"emoji": "🇨🇦", "unicode": "U+1F1E8 U+1F1E6"}, + "CC": {"emoji": "🇨🇨", "unicode": "U+1F1E8 U+1F1E8"}, + "CD": {"emoji": "🇨🇩", "unicode": "U+1F1E8 U+1F1E9"}, + "CF": {"emoji": "🇨🇫", "unicode": "U+1F1E8 U+1F1EB"}, + "CG": {"emoji": "🇨🇬", "unicode": "U+1F1E8 U+1F1EC"}, + "CH": {"emoji": "🇨🇭", "unicode": "U+1F1E8 U+1F1ED"}, + "CI": {"emoji": "🇨🇮", "unicode": "U+1F1E8 U+1F1EE"}, + "CK": {"emoji": "🇨🇰", "unicode": "U+1F1E8 U+1F1F0"}, + "CL": {"emoji": "🇨🇱", "unicode": "U+1F1E8 U+1F1F1"}, + "CM": {"emoji": "🇨🇲", "unicode": "U+1F1E8 U+1F1F2"}, + "CN": {"emoji": "🇨🇳", "unicode": "U+1F1E8 U+1F1F3"}, + "CO": {"emoji": "🇨🇴", "unicode": "U+1F1E8 U+1F1F4"}, + "CR": {"emoji": "🇨🇷", "unicode": "U+1F1E8 U+1F1F7"}, + "CU": {"emoji": "🇨🇺", "unicode": "U+1F1E8 U+1F1FA"}, + "CV": {"emoji": "🇨🇻", "unicode": "U+1F1E8 U+1F1FB"}, + "CW": {"emoji": "🇨🇼", "unicode": "U+1F1E8 U+1F1FC"}, + "CX": {"emoji": "🇨🇽", "unicode": "U+1F1E8 U+1F1FD"}, + "CY": {"emoji": "🇨🇾", "unicode": "U+1F1E8 U+1F1FE"}, + "CZ": {"emoji": "🇨🇿", "unicode": "U+1F1E8 U+1F1FF"}, + "DE": {"emoji": "🇩🇪", "unicode": "U+1F1E9 U+1F1EA"}, + "DJ": {"emoji": "🇩🇯", "unicode": "U+1F1E9 U+1F1EF"}, + "DK": {"emoji": "🇩🇰", "unicode": "U+1F1E9 U+1F1F0"}, + "DM": {"emoji": "🇩🇲", "unicode": "U+1F1E9 U+1F1F2"}, + "DO": {"emoji": "🇩🇴", "unicode": "U+1F1E9 U+1F1F4"}, + "DZ": {"emoji": "🇩🇿", "unicode": "U+1F1E9 U+1F1FF"}, + "EC": {"emoji": "🇪🇨", "unicode": "U+1F1EA U+1F1E8"}, + "EE": {"emoji": "🇪🇪", "unicode": "U+1F1EA U+1F1EA"}, + "EG": {"emoji": "🇪🇬", "unicode": "U+1F1EA U+1F1EC"}, + "EH": {"emoji": "🇪🇭", "unicode": "U+1F1EA U+1F1ED"}, + "ER": {"emoji": "🇪🇷", "unicode": "U+1F1EA U+1F1F7"}, + "ES": {"emoji": "🇪🇸", "unicode": "U+1F1EA U+1F1F8"}, + "ET": {"emoji": "🇪🇹", "unicode": "U+1F1EA U+1F1F9"}, + "FI": {"emoji": "🇫🇮", "unicode": "U+1F1EB U+1F1EE"}, + "FJ": {"emoji": "🇫🇯", "unicode": "U+1F1EB U+1F1EF"}, + "FK": {"emoji": "🇫🇰", "unicode": "U+1F1EB U+1F1F0"}, + "FM": {"emoji": "🇫🇲", "unicode": "U+1F1EB U+1F1F2"}, + "FO": {"emoji": "🇫🇴", "unicode": "U+1F1EB U+1F1F4"}, + "FR": {"emoji": "🇫🇷", "unicode": "U+1F1EB U+1F1F7"}, + "GA": {"emoji": "🇬🇦", "unicode": "U+1F1EC U+1F1E6"}, + "GB": {"emoji": "🇬🇧", "unicode": "U+1F1EC U+1F1E7"}, + "GD": {"emoji": "🇬🇩", "unicode": "U+1F1EC U+1F1E9"}, + "GE": {"emoji": "🇬🇪", "unicode": "U+1F1EC U+1F1EA"}, + "GF": {"emoji": "🇬🇫", "unicode": "U+1F1EC U+1F1EB"}, + "GG": {"emoji": "🇬🇬", "unicode": "U+1F1EC U+1F1EC"}, + "GH": {"emoji": "🇬🇭", "unicode": "U+1F1EC U+1F1ED"}, + "GI": {"emoji": "🇬🇮", "unicode": "U+1F1EC U+1F1EE"}, + "GL": {"emoji": "🇬🇱", "unicode": "U+1F1EC U+1F1F1"}, + "GM": {"emoji": "🇬🇲", "unicode": "U+1F1EC U+1F1F2"}, + "GN": {"emoji": "🇬🇳", "unicode": "U+1F1EC U+1F1F3"}, + "GP": {"emoji": "🇬🇵", "unicode": "U+1F1EC U+1F1F5"}, + "GQ": {"emoji": "🇬🇶", "unicode": "U+1F1EC U+1F1F6"}, + "GR": {"emoji": "🇬🇷", "unicode": "U+1F1EC U+1F1F7"}, + "GS": {"emoji": "🇬🇸", "unicode": "U+1F1EC U+1F1F8"}, + "GT": {"emoji": "🇬🇹", "unicode": "U+1F1EC U+1F1F9"}, + "GU": {"emoji": "🇬🇺", "unicode": "U+1F1EC U+1F1FA"}, + "GW": {"emoji": "🇬🇼", "unicode": "U+1F1EC U+1F1FC"}, + "GY": {"emoji": "🇬🇾", "unicode": "U+1F1EC U+1F1FE"}, + "HK": {"emoji": "🇭🇰", "unicode": "U+1F1ED U+1F1F0"}, + "HM": {"emoji": "🇭🇲", "unicode": "U+1F1ED U+1F1F2"}, + "HN": {"emoji": "🇭🇳", "unicode": "U+1F1ED U+1F1F3"}, + "HR": {"emoji": "🇭🇷", "unicode": "U+1F1ED U+1F1F7"}, + "HT": {"emoji": "🇭🇹", "unicode": "U+1F1ED U+1F1F9"}, + "HU": {"emoji": "🇭🇺", "unicode": "U+1F1ED U+1F1FA"}, + "ID": {"emoji": "🇮🇩", "unicode": "U+1F1EE U+1F1E9"}, + "IE": {"emoji": "🇮🇪", "unicode": "U+1F1EE U+1F1EA"}, + "IL": {"emoji": "🇮🇱", "unicode": "U+1F1EE U+1F1F1"}, + "IM": {"emoji": "🇮🇲", "unicode": "U+1F1EE U+1F1F2"}, + "IN": {"emoji": "🇮🇳", "unicode": "U+1F1EE U+1F1F3"}, + "IO": {"emoji": "🇮🇴", "unicode": "U+1F1EE U+1F1F4"}, + "IQ": {"emoji": "🇮🇶", "unicode": "U+1F1EE U+1F1F6"}, + "IR": {"emoji": "🇮🇷", "unicode": "U+1F1EE U+1F1F7"}, + "IS": {"emoji": "🇮🇸", "unicode": "U+1F1EE U+1F1F8"}, + "IT": {"emoji": "🇮🇹", "unicode": "U+1F1EE U+1F1F9"}, + "JE": {"emoji": "🇯🇪", "unicode": "U+1F1EF U+1F1EA"}, + "JM": {"emoji": "🇯🇲", "unicode": "U+1F1EF U+1F1F2"}, + "JO": {"emoji": "🇯🇴", "unicode": "U+1F1EF U+1F1F4"}, + "JP": {"emoji": "🇯🇵", "unicode": "U+1F1EF U+1F1F5"}, + "KE": {"emoji": "🇰🇪", "unicode": "U+1F1F0 U+1F1EA"}, + "KG": {"emoji": "🇰🇬", "unicode": "U+1F1F0 U+1F1EC"}, + "KH": {"emoji": "🇰🇭", "unicode": "U+1F1F0 U+1F1ED"}, + "KI": {"emoji": "🇰🇮", "unicode": "U+1F1F0 U+1F1EE"}, + "KM": {"emoji": "🇰🇲", "unicode": "U+1F1F0 U+1F1F2"}, + "KN": {"emoji": "🇰🇳", "unicode": "U+1F1F0 U+1F1F3"}, + "KP": {"emoji": "🇰🇵", "unicode": "U+1F1F0 U+1F1F5"}, + "KR": {"emoji": "🇰🇷", "unicode": "U+1F1F0 U+1F1F7"}, + "KW": {"emoji": "🇰🇼", "unicode": "U+1F1F0 U+1F1FC"}, + "KY": {"emoji": "🇰🇾", "unicode": "U+1F1F0 U+1F1FE"}, + "KZ": {"emoji": "🇰🇿", "unicode": "U+1F1F0 U+1F1FF"}, + "LA": {"emoji": "🇱🇦", "unicode": "U+1F1F1 U+1F1E6"}, + "LB": {"emoji": "🇱🇧", "unicode": "U+1F1F1 U+1F1E7"}, + "LC": {"emoji": "🇱🇨", "unicode": "U+1F1F1 U+1F1E8"}, + "LI": {"emoji": "🇱🇮", "unicode": "U+1F1F1 U+1F1EE"}, + "LK": {"emoji": "🇱🇰", "unicode": "U+1F1F1 U+1F1F0"}, + "LR": {"emoji": "🇱🇷", "unicode": "U+1F1F1 U+1F1F7"}, + "LS": {"emoji": "🇱🇸", "unicode": "U+1F1F1 U+1F1F8"}, + "LT": {"emoji": "🇱🇹", "unicode": "U+1F1F1 U+1F1F9"}, + "LU": {"emoji": "🇱🇺", "unicode": "U+1F1F1 U+1F1FA"}, + "LV": {"emoji": "🇱🇻", "unicode": "U+1F1F1 U+1F1FB"}, + "LY": {"emoji": "🇱🇾", "unicode": "U+1F1F1 U+1F1FE"}, + "MA": {"emoji": "🇲🇦", "unicode": "U+1F1F2 U+1F1E6"}, + "MC": {"emoji": "🇲🇨", "unicode": "U+1F1F2 U+1F1E8"}, + "MD": {"emoji": "🇲🇩", "unicode": "U+1F1F2 U+1F1E9"}, + "ME": {"emoji": "🇲🇪", "unicode": "U+1F1F2 U+1F1EA"}, + "MF": {"emoji": "🇲🇫", "unicode": "U+1F1F2 U+1F1EB"}, + "MG": {"emoji": "🇲🇬", "unicode": "U+1F1F2 U+1F1EC"}, + "MH": {"emoji": "🇲🇭", "unicode": "U+1F1F2 U+1F1ED"}, + "MK": {"emoji": "🇲🇰", "unicode": "U+1F1F2 U+1F1F0"}, + "ML": {"emoji": "🇲🇱", "unicode": "U+1F1F2 U+1F1F1"}, + "MM": {"emoji": "🇲🇲", "unicode": "U+1F1F2 U+1F1F2"}, + "MN": {"emoji": "🇲🇳", "unicode": "U+1F1F2 U+1F1F3"}, + "MO": {"emoji": "🇲🇴", "unicode": "U+1F1F2 U+1F1F4"}, + "MP": {"emoji": "🇲🇵", "unicode": "U+1F1F2 U+1F1F5"}, + "MQ": {"emoji": "🇲🇶", "unicode": "U+1F1F2 U+1F1F6"}, + "MR": {"emoji": "🇲🇷", "unicode": "U+1F1F2 U+1F1F7"}, + "MS": {"emoji": "🇲🇸", "unicode": "U+1F1F2 U+1F1F8"}, + "MT": {"emoji": "🇲🇹", "unicode": "U+1F1F2 U+1F1F9"}, + "MU": {"emoji": "🇲🇺", "unicode": "U+1F1F2 U+1F1FA"}, + "MV": {"emoji": "🇲🇻", "unicode": "U+1F1F2 U+1F1FB"}, + "MW": {"emoji": "🇲🇼", "unicode": "U+1F1F2 U+1F1FC"}, + "MX": {"emoji": "🇲🇽", "unicode": "U+1F1F2 U+1F1FD"}, + "MY": {"emoji": "🇲🇾", "unicode": "U+1F1F2 U+1F1FE"}, + "MZ": {"emoji": "🇲🇿", "unicode": "U+1F1F2 U+1F1FF"}, + "NA": {"emoji": "🇳🇦", "unicode": "U+1F1F3 U+1F1E6"}, + "NC": {"emoji": "🇳🇨", "unicode": "U+1F1F3 U+1F1E8"}, + "NE": {"emoji": "🇳🇪", "unicode": "U+1F1F3 U+1F1EA"}, + "NF": {"emoji": "🇳🇫", "unicode": "U+1F1F3 U+1F1EB"}, + "NG": {"emoji": "🇳🇬", "unicode": "U+1F1F3 U+1F1EC"}, + "NI": {"emoji": "🇳🇮", "unicode": "U+1F1F3 U+1F1EE"}, + "NL": {"emoji": "🇳🇱", "unicode": "U+1F1F3 U+1F1F1"}, + "NO": {"emoji": "🇳🇴", "unicode": "U+1F1F3 U+1F1F4"}, + "NP": {"emoji": "🇳🇵", "unicode": "U+1F1F3 U+1F1F5"}, + "NR": {"emoji": "🇳🇷", "unicode": "U+1F1F3 U+1F1F7"}, + "NU": {"emoji": "🇳🇺", "unicode": "U+1F1F3 U+1F1FA"}, + "NZ": {"emoji": "🇳🇿", "unicode": "U+1F1F3 U+1F1FF"}, + "OM": {"emoji": "🇴🇲", "unicode": "U+1F1F4 U+1F1F2"}, + "PA": {"emoji": "🇵🇦", "unicode": "U+1F1F5 U+1F1E6"}, + "PE": {"emoji": "🇵🇪", "unicode": "U+1F1F5 U+1F1EA"}, + "PF": {"emoji": "🇵🇫", "unicode": "U+1F1F5 U+1F1EB"}, + "PG": {"emoji": "🇵🇬", "unicode": "U+1F1F5 U+1F1EC"}, + "PH": {"emoji": "🇵🇭", "unicode": "U+1F1F5 U+1F1ED"}, + "PK": {"emoji": "🇵🇰", "unicode": "U+1F1F5 U+1F1F0"}, + "PL": {"emoji": "🇵🇱", "unicode": "U+1F1F5 U+1F1F1"}, + "PM": {"emoji": "🇵🇲", "unicode": "U+1F1F5 U+1F1F2"}, + "PN": {"emoji": "🇵🇳", "unicode": "U+1F1F5 U+1F1F3"}, + "PR": {"emoji": "🇵🇷", "unicode": "U+1F1F5 U+1F1F7"}, + "PS": {"emoji": "🇵🇸", "unicode": "U+1F1F5 U+1F1F8"}, + "PT": {"emoji": "🇵🇹", "unicode": "U+1F1F5 U+1F1F9"}, + "PW": {"emoji": "🇵🇼", "unicode": "U+1F1F5 U+1F1FC"}, + "PY": {"emoji": "🇵🇾", "unicode": "U+1F1F5 U+1F1FE"}, + "QA": {"emoji": "🇶🇦", "unicode": "U+1F1F6 U+1F1E6"}, + "RE": {"emoji": "🇷🇪", "unicode": "U+1F1F7 U+1F1EA"}, + "RO": {"emoji": "🇷🇴", "unicode": "U+1F1F7 U+1F1F4"}, + "RS": {"emoji": "🇷🇸", "unicode": "U+1F1F7 U+1F1F8"}, + "RU": {"emoji": "🇷🇺", "unicode": "U+1F1F7 U+1F1FA"}, + "RW": {"emoji": "🇷🇼", "unicode": "U+1F1F7 U+1F1FC"}, + "SA": {"emoji": "🇸🇦", "unicode": "U+1F1F8 U+1F1E6"}, + "SB": {"emoji": "🇸🇧", "unicode": "U+1F1F8 U+1F1E7"}, + "SC": {"emoji": "🇸🇨", "unicode": "U+1F1F8 U+1F1E8"}, + "SD": {"emoji": "🇸🇩", "unicode": "U+1F1F8 U+1F1E9"}, + "SE": {"emoji": "🇸🇪", "unicode": "U+1F1F8 U+1F1EA"}, + "SG": {"emoji": "🇸🇬", "unicode": "U+1F1F8 U+1F1EC"}, + "SH": {"emoji": "🇸🇭", "unicode": "U+1F1F8 U+1F1ED"}, + "SI": {"emoji": "🇸🇮", "unicode": "U+1F1F8 U+1F1EE"}, + "SJ": {"emoji": "🇸🇯", "unicode": "U+1F1F8 U+1F1EF"}, + "SK": {"emoji": "🇸🇰", "unicode": "U+1F1F8 U+1F1F0"}, + "SL": {"emoji": "🇸🇱", "unicode": "U+1F1F8 U+1F1F1"}, + "SM": {"emoji": "🇸🇲", "unicode": "U+1F1F8 U+1F1F2"}, + "SN": {"emoji": "🇸🇳", "unicode": "U+1F1F8 U+1F1F3"}, + "SO": {"emoji": "🇸🇴", "unicode": "U+1F1F8 U+1F1F4"}, + "SR": {"emoji": "🇸🇷", "unicode": "U+1F1F8 U+1F1F7"}, + "SS": {"emoji": "🇸🇸", "unicode": "U+1F1F8 U+1F1F8"}, + "ST": {"emoji": "🇸🇹", "unicode": "U+1F1F8 U+1F1F9"}, + "SV": {"emoji": "🇸🇻", "unicode": "U+1F1F8 U+1F1FB"}, + "SX": {"emoji": "🇸🇽", "unicode": "U+1F1F8 U+1F1FD"}, + "SY": {"emoji": "🇸🇾", "unicode": "U+1F1F8 U+1F1FE"}, + "SZ": {"emoji": "🇸🇿", "unicode": "U+1F1F8 U+1F1FF"}, + "TC": {"emoji": "🇹🇨", "unicode": "U+1F1F9 U+1F1E8"}, + "TD": {"emoji": "🇹🇩", "unicode": "U+1F1F9 U+1F1E9"}, + "TF": {"emoji": "🇹🇫", "unicode": "U+1F1F9 U+1F1EB"}, + "TG": {"emoji": "🇹🇬", "unicode": "U+1F1F9 U+1F1EC"}, + "TH": {"emoji": "🇹🇭", "unicode": "U+1F1F9 U+1F1ED"}, + "TJ": {"emoji": "🇹🇯", "unicode": "U+1F1F9 U+1F1EF"}, + "TK": {"emoji": "🇹🇰", "unicode": "U+1F1F9 U+1F1F0"}, + "TL": {"emoji": "🇹🇱", "unicode": "U+1F1F9 U+1F1F1"}, + "TM": {"emoji": "🇹🇲", "unicode": "U+1F1F9 U+1F1F2"}, + "TN": {"emoji": "🇹🇳", "unicode": "U+1F1F9 U+1F1F3"}, + "TO": {"emoji": "🇹🇴", "unicode": "U+1F1F9 U+1F1F4"}, + "TR": {"emoji": "🇹🇷", "unicode": "U+1F1F9 U+1F1F7"}, + "TT": {"emoji": "🇹🇹", "unicode": "U+1F1F9 U+1F1F9"}, + "TV": {"emoji": "🇹🇻", "unicode": "U+1F1F9 U+1F1FB"}, + "TW": {"emoji": "🇹🇼", "unicode": "U+1F1F9 U+1F1FC"}, + "TZ": {"emoji": "🇹🇿", "unicode": "U+1F1F9 U+1F1FF"}, + "UA": {"emoji": "🇺🇦", "unicode": "U+1F1FA U+1F1E6"}, + "UG": {"emoji": "🇺🇬", "unicode": "U+1F1FA U+1F1EC"}, + "UM": {"emoji": "🇺🇲", "unicode": "U+1F1FA U+1F1F2"}, + "US": {"emoji": "🇺🇸", "unicode": "U+1F1FA U+1F1F8"}, + "UY": {"emoji": "🇺🇾", "unicode": "U+1F1FA U+1F1FE"}, + "UZ": {"emoji": "🇺🇿", "unicode": "U+1F1FA U+1F1FF"}, + "VA": {"emoji": "🇻🇦", "unicode": "U+1F1FB U+1F1E6"}, + "VC": {"emoji": "🇻🇨", "unicode": "U+1F1FB U+1F1E8"}, + "VE": {"emoji": "🇻🇪", "unicode": "U+1F1FB U+1F1EA"}, + "VG": {"emoji": "🇻🇬", "unicode": "U+1F1FB U+1F1EC"}, + "VI": {"emoji": "🇻🇮", "unicode": "U+1F1FB U+1F1EE"}, + "VN": {"emoji": "🇻🇳", "unicode": "U+1F1FB U+1F1F3"}, + "VU": {"emoji": "🇻🇺", "unicode": "U+1F1FB U+1F1FA"}, + "WF": {"emoji": "🇼🇫", "unicode": "U+1F1FC U+1F1EB"}, + "WS": {"emoji": "🇼🇸", "unicode": "U+1F1FC U+1F1F8"}, + "XK": {"emoji": "🇽🇰", "unicode": "U+1F1FD U+1F1F0"}, + "YE": {"emoji": "🇾🇪", "unicode": "U+1F1FE U+1F1EA"}, + "YT": {"emoji": "🇾🇹", "unicode": "U+1F1FE U+1F1F9"}, + "ZA": {"emoji": "🇿🇦", "unicode": "U+1F1FF U+1F1E6"}, + "ZM": {"emoji": "🇿🇲", "unicode": "U+1F1FF U+1F1F2"}, + "ZW": {"emoji": "🇿🇼", "unicode": "U+1F1FF U+1F1FC"}, +} diff --git a/ipinfo/details.py b/ipinfo/details.py index 8b0d3fb..1c59306 100644 --- a/ipinfo/details.py +++ b/ipinfo/details.py @@ -13,9 +13,7 @@ def __init__(self, details): def __getattr__(self, attr): """Return attribute if it exists in details array, else return error.""" if attr not in self.details: - raise AttributeError( - f"{attr} is not a valid attribute of Details" - ) + raise AttributeError(f"{attr} is not a valid attribute of Details") return self.details[attr] diff --git a/ipinfo/eu.py b/ipinfo/eu.py deleted file mode 100644 index 5179ed4..0000000 --- a/ipinfo/eu.py +++ /dev/null @@ -1,2 +0,0 @@ -eu_countries = ["IE", "AT", "LT", "LU", "LV", "DE", "DK", "SE", "SI", "SK", "CZ", "CY", "NL", "FI", "FR", "MT", "ES", - "IT", "EE", "PL", "PT", "HU", "HR", "GR", "RO", "BG", "BE"] diff --git a/ipinfo/flags.py b/ipinfo/flags.py deleted file mode 100644 index d9fdaa9..0000000 --- a/ipinfo/flags.py +++ /dev/null @@ -1,252 +0,0 @@ -countries_flags = { - "AD": {"emoji": "🇦🇩", "unicode": "U+1F1E6 U+1F1E9"}, - "AE": {"emoji": "🇦🇪", "unicode": "U+1F1E6 U+1F1EA"}, - "AF": {"emoji": "🇦🇫", "unicode": "U+1F1E6 U+1F1EB"}, - "AG": {"emoji": "🇦🇬", "unicode": "U+1F1E6 U+1F1EC"}, - "AI": {"emoji": "🇦🇮", "unicode": "U+1F1E6 U+1F1EE"}, - "AL": {"emoji": "🇦🇱", "unicode": "U+1F1E6 U+1F1F1"}, - "AM": {"emoji": "🇦🇲", "unicode": "U+1F1E6 U+1F1F2"}, - "AO": {"emoji": "🇦🇴", "unicode": "U+1F1E6 U+1F1F4"}, - "AQ": {"emoji": "🇦🇶", "unicode": "U+1F1E6 U+1F1F6"}, - "AR": {"emoji": "🇦🇷", "unicode": "U+1F1E6 U+1F1F7"}, - "AS": {"emoji": "🇦🇸", "unicode": "U+1F1E6 U+1F1F8"}, - "AT": {"emoji": "🇦🇹", "unicode": "U+1F1E6 U+1F1F9"}, - "AU": {"emoji": "🇦🇺", "unicode": "U+1F1E6 U+1F1FA"}, - "AW": {"emoji": "🇦🇼", "unicode": "U+1F1E6 U+1F1FC"}, - "AX": {"emoji": "🇦🇽", "unicode": "U+1F1E6 U+1F1FD"}, - "AZ": {"emoji": "🇦🇿", "unicode": "U+1F1E6 U+1F1FF"}, - "BA": {"emoji": "🇧🇦", "unicode": "U+1F1E7 U+1F1E6"}, - "BB": {"emoji": "🇧🇧", "unicode": "U+1F1E7 U+1F1E7"}, - "BD": {"emoji": "🇧🇩", "unicode": "U+1F1E7 U+1F1E9"}, - "BE": {"emoji": "🇧🇪", "unicode": "U+1F1E7 U+1F1EA"}, - "BF": {"emoji": "🇧🇫", "unicode": "U+1F1E7 U+1F1EB"}, - "BG": {"emoji": "🇧🇬", "unicode": "U+1F1E7 U+1F1EC"}, - "BH": {"emoji": "🇧🇭", "unicode": "U+1F1E7 U+1F1ED"}, - "BI": {"emoji": "🇧🇮", "unicode": "U+1F1E7 U+1F1EE"}, - "BJ": {"emoji": "🇧🇯", "unicode": "U+1F1E7 U+1F1EF"}, - "BL": {"emoji": "🇧🇱", "unicode": "U+1F1E7 U+1F1F1"}, - "BM": {"emoji": "🇧🇲", "unicode": "U+1F1E7 U+1F1F2"}, - "BN": {"emoji": "🇧🇳", "unicode": "U+1F1E7 U+1F1F3"}, - "BO": {"emoji": "🇧🇴", "unicode": "U+1F1E7 U+1F1F4"}, - "BQ": {"emoji": "🇧🇶", "unicode": "U+1F1E7 U+1F1F6"}, - "BR": {"emoji": "🇧🇷", "unicode": "U+1F1E7 U+1F1F7"}, - "BS": {"emoji": "🇧🇸", "unicode": "U+1F1E7 U+1F1F8"}, - "BT": {"emoji": "🇧🇹", "unicode": "U+1F1E7 U+1F1F9"}, - "BV": {"emoji": "🇧🇻", "unicode": "U+1F1E7 U+1F1FB"}, - "BW": {"emoji": "🇧🇼", "unicode": "U+1F1E7 U+1F1FC"}, - "BY": {"emoji": "🇧🇾", "unicode": "U+1F1E7 U+1F1FE"}, - "BZ": {"emoji": "🇧🇿", "unicode": "U+1F1E7 U+1F1FF"}, - "CA": {"emoji": "🇨🇦", "unicode": "U+1F1E8 U+1F1E6"}, - "CC": {"emoji": "🇨🇨", "unicode": "U+1F1E8 U+1F1E8"}, - "CD": {"emoji": "🇨🇩", "unicode": "U+1F1E8 U+1F1E9"}, - "CF": {"emoji": "🇨🇫", "unicode": "U+1F1E8 U+1F1EB"}, - "CG": {"emoji": "🇨🇬", "unicode": "U+1F1E8 U+1F1EC"}, - "CH": {"emoji": "🇨🇭", "unicode": "U+1F1E8 U+1F1ED"}, - "CI": {"emoji": "🇨🇮", "unicode": "U+1F1E8 U+1F1EE"}, - "CK": {"emoji": "🇨🇰", "unicode": "U+1F1E8 U+1F1F0"}, - "CL": {"emoji": "🇨🇱", "unicode": "U+1F1E8 U+1F1F1"}, - "CM": {"emoji": "🇨🇲", "unicode": "U+1F1E8 U+1F1F2"}, - "CN": {"emoji": "🇨🇳", "unicode": "U+1F1E8 U+1F1F3"}, - "CO": {"emoji": "🇨🇴", "unicode": "U+1F1E8 U+1F1F4"}, - "CR": {"emoji": "🇨🇷", "unicode": "U+1F1E8 U+1F1F7"}, - "CU": {"emoji": "🇨🇺", "unicode": "U+1F1E8 U+1F1FA"}, - "CV": {"emoji": "🇨🇻", "unicode": "U+1F1E8 U+1F1FB"}, - "CW": {"emoji": "🇨🇼", "unicode": "U+1F1E8 U+1F1FC"}, - "CX": {"emoji": "🇨🇽", "unicode": "U+1F1E8 U+1F1FD"}, - "CY": {"emoji": "🇨🇾", "unicode": "U+1F1E8 U+1F1FE"}, - "CZ": {"emoji": "🇨🇿", "unicode": "U+1F1E8 U+1F1FF"}, - "DE": {"emoji": "🇩🇪", "unicode": "U+1F1E9 U+1F1EA"}, - "DJ": {"emoji": "🇩🇯", "unicode": "U+1F1E9 U+1F1EF"}, - "DK": {"emoji": "🇩🇰", "unicode": "U+1F1E9 U+1F1F0"}, - "DM": {"emoji": "🇩🇲", "unicode": "U+1F1E9 U+1F1F2"}, - "DO": {"emoji": "🇩🇴", "unicode": "U+1F1E9 U+1F1F4"}, - "DZ": {"emoji": "🇩🇿", "unicode": "U+1F1E9 U+1F1FF"}, - "EC": {"emoji": "🇪🇨", "unicode": "U+1F1EA U+1F1E8"}, - "EE": {"emoji": "🇪🇪", "unicode": "U+1F1EA U+1F1EA"}, - "EG": {"emoji": "🇪🇬", "unicode": "U+1F1EA U+1F1EC"}, - "EH": {"emoji": "🇪🇭", "unicode": "U+1F1EA U+1F1ED"}, - "ER": {"emoji": "🇪🇷", "unicode": "U+1F1EA U+1F1F7"}, - "ES": {"emoji": "🇪🇸", "unicode": "U+1F1EA U+1F1F8"}, - "ET": {"emoji": "🇪🇹", "unicode": "U+1F1EA U+1F1F9"}, - "FI": {"emoji": "🇫🇮", "unicode": "U+1F1EB U+1F1EE"}, - "FJ": {"emoji": "🇫🇯", "unicode": "U+1F1EB U+1F1EF"}, - "FK": {"emoji": "🇫🇰", "unicode": "U+1F1EB U+1F1F0"}, - "FM": {"emoji": "🇫🇲", "unicode": "U+1F1EB U+1F1F2"}, - "FO": {"emoji": "🇫🇴", "unicode": "U+1F1EB U+1F1F4"}, - "FR": {"emoji": "🇫🇷", "unicode": "U+1F1EB U+1F1F7"}, - "GA": {"emoji": "🇬🇦", "unicode": "U+1F1EC U+1F1E6"}, - "GB": {"emoji": "🇬🇧", "unicode": "U+1F1EC U+1F1E7"}, - "GD": {"emoji": "🇬🇩", "unicode": "U+1F1EC U+1F1E9"}, - "GE": {"emoji": "🇬🇪", "unicode": "U+1F1EC U+1F1EA"}, - "GF": {"emoji": "🇬🇫", "unicode": "U+1F1EC U+1F1EB"}, - "GG": {"emoji": "🇬🇬", "unicode": "U+1F1EC U+1F1EC"}, - "GH": {"emoji": "🇬🇭", "unicode": "U+1F1EC U+1F1ED"}, - "GI": {"emoji": "🇬🇮", "unicode": "U+1F1EC U+1F1EE"}, - "GL": {"emoji": "🇬🇱", "unicode": "U+1F1EC U+1F1F1"}, - "GM": {"emoji": "🇬🇲", "unicode": "U+1F1EC U+1F1F2"}, - "GN": {"emoji": "🇬🇳", "unicode": "U+1F1EC U+1F1F3"}, - "GP": {"emoji": "🇬🇵", "unicode": "U+1F1EC U+1F1F5"}, - "GQ": {"emoji": "🇬🇶", "unicode": "U+1F1EC U+1F1F6"}, - "GR": {"emoji": "🇬🇷", "unicode": "U+1F1EC U+1F1F7"}, - "GS": {"emoji": "🇬🇸", "unicode": "U+1F1EC U+1F1F8"}, - "GT": {"emoji": "🇬🇹", "unicode": "U+1F1EC U+1F1F9"}, - "GU": {"emoji": "🇬🇺", "unicode": "U+1F1EC U+1F1FA"}, - "GW": {"emoji": "🇬🇼", "unicode": "U+1F1EC U+1F1FC"}, - "GY": {"emoji": "🇬🇾", "unicode": "U+1F1EC U+1F1FE"}, - "HK": {"emoji": "🇭🇰", "unicode": "U+1F1ED U+1F1F0"}, - "HM": {"emoji": "🇭🇲", "unicode": "U+1F1ED U+1F1F2"}, - "HN": {"emoji": "🇭🇳", "unicode": "U+1F1ED U+1F1F3"}, - "HR": {"emoji": "🇭🇷", "unicode": "U+1F1ED U+1F1F7"}, - "HT": {"emoji": "🇭🇹", "unicode": "U+1F1ED U+1F1F9"}, - "HU": {"emoji": "🇭🇺", "unicode": "U+1F1ED U+1F1FA"}, - "ID": {"emoji": "🇮🇩", "unicode": "U+1F1EE U+1F1E9"}, - "IE": {"emoji": "🇮🇪", "unicode": "U+1F1EE U+1F1EA"}, - "IL": {"emoji": "🇮🇱", "unicode": "U+1F1EE U+1F1F1"}, - "IM": {"emoji": "🇮🇲", "unicode": "U+1F1EE U+1F1F2"}, - "IN": {"emoji": "🇮🇳", "unicode": "U+1F1EE U+1F1F3"}, - "IO": {"emoji": "🇮🇴", "unicode": "U+1F1EE U+1F1F4"}, - "IQ": {"emoji": "🇮🇶", "unicode": "U+1F1EE U+1F1F6"}, - "IR": {"emoji": "🇮🇷", "unicode": "U+1F1EE U+1F1F7"}, - "IS": {"emoji": "🇮🇸", "unicode": "U+1F1EE U+1F1F8"}, - "IT": {"emoji": "🇮🇹", "unicode": "U+1F1EE U+1F1F9"}, - "JE": {"emoji": "🇯🇪", "unicode": "U+1F1EF U+1F1EA"}, - "JM": {"emoji": "🇯🇲", "unicode": "U+1F1EF U+1F1F2"}, - "JO": {"emoji": "🇯🇴", "unicode": "U+1F1EF U+1F1F4"}, - "JP": {"emoji": "🇯🇵", "unicode": "U+1F1EF U+1F1F5"}, - "KE": {"emoji": "🇰🇪", "unicode": "U+1F1F0 U+1F1EA"}, - "KG": {"emoji": "🇰🇬", "unicode": "U+1F1F0 U+1F1EC"}, - "KH": {"emoji": "🇰🇭", "unicode": "U+1F1F0 U+1F1ED"}, - "KI": {"emoji": "🇰🇮", "unicode": "U+1F1F0 U+1F1EE"}, - "KM": {"emoji": "🇰🇲", "unicode": "U+1F1F0 U+1F1F2"}, - "KN": {"emoji": "🇰🇳", "unicode": "U+1F1F0 U+1F1F3"}, - "KP": {"emoji": "🇰🇵", "unicode": "U+1F1F0 U+1F1F5"}, - "KR": {"emoji": "🇰🇷", "unicode": "U+1F1F0 U+1F1F7"}, - "KW": {"emoji": "🇰🇼", "unicode": "U+1F1F0 U+1F1FC"}, - "KY": {"emoji": "🇰🇾", "unicode": "U+1F1F0 U+1F1FE"}, - "KZ": {"emoji": "🇰🇿", "unicode": "U+1F1F0 U+1F1FF"}, - "LA": {"emoji": "🇱🇦", "unicode": "U+1F1F1 U+1F1E6"}, - "LB": {"emoji": "🇱🇧", "unicode": "U+1F1F1 U+1F1E7"}, - "LC": {"emoji": "🇱🇨", "unicode": "U+1F1F1 U+1F1E8"}, - "LI": {"emoji": "🇱🇮", "unicode": "U+1F1F1 U+1F1EE"}, - "LK": {"emoji": "🇱🇰", "unicode": "U+1F1F1 U+1F1F0"}, - "LR": {"emoji": "🇱🇷", "unicode": "U+1F1F1 U+1F1F7"}, - "LS": {"emoji": "🇱🇸", "unicode": "U+1F1F1 U+1F1F8"}, - "LT": {"emoji": "🇱🇹", "unicode": "U+1F1F1 U+1F1F9"}, - "LU": {"emoji": "🇱🇺", "unicode": "U+1F1F1 U+1F1FA"}, - "LV": {"emoji": "🇱🇻", "unicode": "U+1F1F1 U+1F1FB"}, - "LY": {"emoji": "🇱🇾", "unicode": "U+1F1F1 U+1F1FE"}, - "MA": {"emoji": "🇲🇦", "unicode": "U+1F1F2 U+1F1E6"}, - "MC": {"emoji": "🇲🇨", "unicode": "U+1F1F2 U+1F1E8"}, - "MD": {"emoji": "🇲🇩", "unicode": "U+1F1F2 U+1F1E9"}, - "ME": {"emoji": "🇲🇪", "unicode": "U+1F1F2 U+1F1EA"}, - "MF": {"emoji": "🇲🇫", "unicode": "U+1F1F2 U+1F1EB"}, - "MG": {"emoji": "🇲🇬", "unicode": "U+1F1F2 U+1F1EC"}, - "MH": {"emoji": "🇲🇭", "unicode": "U+1F1F2 U+1F1ED"}, - "MK": {"emoji": "🇲🇰", "unicode": "U+1F1F2 U+1F1F0"}, - "ML": {"emoji": "🇲🇱", "unicode": "U+1F1F2 U+1F1F1"}, - "MM": {"emoji": "🇲🇲", "unicode": "U+1F1F2 U+1F1F2"}, - "MN": {"emoji": "🇲🇳", "unicode": "U+1F1F2 U+1F1F3"}, - "MO": {"emoji": "🇲🇴", "unicode": "U+1F1F2 U+1F1F4"}, - "MP": {"emoji": "🇲🇵", "unicode": "U+1F1F2 U+1F1F5"}, - "MQ": {"emoji": "🇲🇶", "unicode": "U+1F1F2 U+1F1F6"}, - "MR": {"emoji": "🇲🇷", "unicode": "U+1F1F2 U+1F1F7"}, - "MS": {"emoji": "🇲🇸", "unicode": "U+1F1F2 U+1F1F8"}, - "MT": {"emoji": "🇲🇹", "unicode": "U+1F1F2 U+1F1F9"}, - "MU": {"emoji": "🇲🇺", "unicode": "U+1F1F2 U+1F1FA"}, - "MV": {"emoji": "🇲🇻", "unicode": "U+1F1F2 U+1F1FB"}, - "MW": {"emoji": "🇲🇼", "unicode": "U+1F1F2 U+1F1FC"}, - "MX": {"emoji": "🇲🇽", "unicode": "U+1F1F2 U+1F1FD"}, - "MY": {"emoji": "🇲🇾", "unicode": "U+1F1F2 U+1F1FE"}, - "MZ": {"emoji": "🇲🇿", "unicode": "U+1F1F2 U+1F1FF"}, - "NA": {"emoji": "🇳🇦", "unicode": "U+1F1F3 U+1F1E6"}, - "NC": {"emoji": "🇳🇨", "unicode": "U+1F1F3 U+1F1E8"}, - "NE": {"emoji": "🇳🇪", "unicode": "U+1F1F3 U+1F1EA"}, - "NF": {"emoji": "🇳🇫", "unicode": "U+1F1F3 U+1F1EB"}, - "NG": {"emoji": "🇳🇬", "unicode": "U+1F1F3 U+1F1EC"}, - "NI": {"emoji": "🇳🇮", "unicode": "U+1F1F3 U+1F1EE"}, - "NL": {"emoji": "🇳🇱", "unicode": "U+1F1F3 U+1F1F1"}, - "NO": {"emoji": "🇳🇴", "unicode": "U+1F1F3 U+1F1F4"}, - "NP": {"emoji": "🇳🇵", "unicode": "U+1F1F3 U+1F1F5"}, - "NR": {"emoji": "🇳🇷", "unicode": "U+1F1F3 U+1F1F7"}, - "NU": {"emoji": "🇳🇺", "unicode": "U+1F1F3 U+1F1FA"}, - "NZ": {"emoji": "🇳🇿", "unicode": "U+1F1F3 U+1F1FF"}, - "OM": {"emoji": "🇴🇲", "unicode": "U+1F1F4 U+1F1F2"}, - "PA": {"emoji": "🇵🇦", "unicode": "U+1F1F5 U+1F1E6"}, - "PE": {"emoji": "🇵🇪", "unicode": "U+1F1F5 U+1F1EA"}, - "PF": {"emoji": "🇵🇫", "unicode": "U+1F1F5 U+1F1EB"}, - "PG": {"emoji": "🇵🇬", "unicode": "U+1F1F5 U+1F1EC"}, - "PH": {"emoji": "🇵🇭", "unicode": "U+1F1F5 U+1F1ED"}, - "PK": {"emoji": "🇵🇰", "unicode": "U+1F1F5 U+1F1F0"}, - "PL": {"emoji": "🇵🇱", "unicode": "U+1F1F5 U+1F1F1"}, - "PM": {"emoji": "🇵🇲", "unicode": "U+1F1F5 U+1F1F2"}, - "PN": {"emoji": "🇵🇳", "unicode": "U+1F1F5 U+1F1F3"}, - "PR": {"emoji": "🇵🇷", "unicode": "U+1F1F5 U+1F1F7"}, - "PS": {"emoji": "🇵🇸", "unicode": "U+1F1F5 U+1F1F8"}, - "PT": {"emoji": "🇵🇹", "unicode": "U+1F1F5 U+1F1F9"}, - "PW": {"emoji": "🇵🇼", "unicode": "U+1F1F5 U+1F1FC"}, - "PY": {"emoji": "🇵🇾", "unicode": "U+1F1F5 U+1F1FE"}, - "QA": {"emoji": "🇶🇦", "unicode": "U+1F1F6 U+1F1E6"}, - "RE": {"emoji": "🇷🇪", "unicode": "U+1F1F7 U+1F1EA"}, - "RO": {"emoji": "🇷🇴", "unicode": "U+1F1F7 U+1F1F4"}, - "RS": {"emoji": "🇷🇸", "unicode": "U+1F1F7 U+1F1F8"}, - "RU": {"emoji": "🇷🇺", "unicode": "U+1F1F7 U+1F1FA"}, - "RW": {"emoji": "🇷🇼", "unicode": "U+1F1F7 U+1F1FC"}, - "SA": {"emoji": "🇸🇦", "unicode": "U+1F1F8 U+1F1E6"}, - "SB": {"emoji": "🇸🇧", "unicode": "U+1F1F8 U+1F1E7"}, - "SC": {"emoji": "🇸🇨", "unicode": "U+1F1F8 U+1F1E8"}, - "SD": {"emoji": "🇸🇩", "unicode": "U+1F1F8 U+1F1E9"}, - "SE": {"emoji": "🇸🇪", "unicode": "U+1F1F8 U+1F1EA"}, - "SG": {"emoji": "🇸🇬", "unicode": "U+1F1F8 U+1F1EC"}, - "SH": {"emoji": "🇸🇭", "unicode": "U+1F1F8 U+1F1ED"}, - "SI": {"emoji": "🇸🇮", "unicode": "U+1F1F8 U+1F1EE"}, - "SJ": {"emoji": "🇸🇯", "unicode": "U+1F1F8 U+1F1EF"}, - "SK": {"emoji": "🇸🇰", "unicode": "U+1F1F8 U+1F1F0"}, - "SL": {"emoji": "🇸🇱", "unicode": "U+1F1F8 U+1F1F1"}, - "SM": {"emoji": "🇸🇲", "unicode": "U+1F1F8 U+1F1F2"}, - "SN": {"emoji": "🇸🇳", "unicode": "U+1F1F8 U+1F1F3"}, - "SO": {"emoji": "🇸🇴", "unicode": "U+1F1F8 U+1F1F4"}, - "SR": {"emoji": "🇸🇷", "unicode": "U+1F1F8 U+1F1F7"}, - "SS": {"emoji": "🇸🇸", "unicode": "U+1F1F8 U+1F1F8"}, - "ST": {"emoji": "🇸🇹", "unicode": "U+1F1F8 U+1F1F9"}, - "SV": {"emoji": "🇸🇻", "unicode": "U+1F1F8 U+1F1FB"}, - "SX": {"emoji": "🇸🇽", "unicode": "U+1F1F8 U+1F1FD"}, - "SY": {"emoji": "🇸🇾", "unicode": "U+1F1F8 U+1F1FE"}, - "SZ": {"emoji": "🇸🇿", "unicode": "U+1F1F8 U+1F1FF"}, - "TC": {"emoji": "🇹🇨", "unicode": "U+1F1F9 U+1F1E8"}, - "TD": {"emoji": "🇹🇩", "unicode": "U+1F1F9 U+1F1E9"}, - "TF": {"emoji": "🇹🇫", "unicode": "U+1F1F9 U+1F1EB"}, - "TG": {"emoji": "🇹🇬", "unicode": "U+1F1F9 U+1F1EC"}, - "TH": {"emoji": "🇹🇭", "unicode": "U+1F1F9 U+1F1ED"}, - "TJ": {"emoji": "🇹🇯", "unicode": "U+1F1F9 U+1F1EF"}, - "TK": {"emoji": "🇹🇰", "unicode": "U+1F1F9 U+1F1F0"}, - "TL": {"emoji": "🇹🇱", "unicode": "U+1F1F9 U+1F1F1"}, - "TM": {"emoji": "🇹🇲", "unicode": "U+1F1F9 U+1F1F2"}, - "TN": {"emoji": "🇹🇳", "unicode": "U+1F1F9 U+1F1F3"}, - "TO": {"emoji": "🇹🇴", "unicode": "U+1F1F9 U+1F1F4"}, - "TR": {"emoji": "🇹🇷", "unicode": "U+1F1F9 U+1F1F7"}, - "TT": {"emoji": "🇹🇹", "unicode": "U+1F1F9 U+1F1F9"}, - "TV": {"emoji": "🇹🇻", "unicode": "U+1F1F9 U+1F1FB"}, - "TW": {"emoji": "🇹🇼", "unicode": "U+1F1F9 U+1F1FC"}, - "TZ": {"emoji": "🇹🇿", "unicode": "U+1F1F9 U+1F1FF"}, - "UA": {"emoji": "🇺🇦", "unicode": "U+1F1FA U+1F1E6"}, - "UG": {"emoji": "🇺🇬", "unicode": "U+1F1FA U+1F1EC"}, - "UM": {"emoji": "🇺🇲", "unicode": "U+1F1FA U+1F1F2"}, - "US": {"emoji": "🇺🇸", "unicode": "U+1F1FA U+1F1F8"}, - "UY": {"emoji": "🇺🇾", "unicode": "U+1F1FA U+1F1FE"}, - "UZ": {"emoji": "🇺🇿", "unicode": "U+1F1FA U+1F1FF"}, - "VA": {"emoji": "🇻🇦", "unicode": "U+1F1FB U+1F1E6"}, - "VC": {"emoji": "🇻🇨", "unicode": "U+1F1FB U+1F1E8"}, - "VE": {"emoji": "🇻🇪", "unicode": "U+1F1FB U+1F1EA"}, - "VG": {"emoji": "🇻🇬", "unicode": "U+1F1FB U+1F1EC"}, - "VI": {"emoji": "🇻🇮", "unicode": "U+1F1FB U+1F1EE"}, - "VN": {"emoji": "🇻🇳", "unicode": "U+1F1FB U+1F1F3"}, - "VU": {"emoji": "🇻🇺", "unicode": "U+1F1FB U+1F1FA"}, - "WF": {"emoji": "🇼🇫", "unicode": "U+1F1FC U+1F1EB"}, - "WS": {"emoji": "🇼🇸", "unicode": "U+1F1FC U+1F1F8"}, - "XK": {"emoji": "🇽🇰", "unicode": "U+1F1FD U+1F1F0"}, - "YE": {"emoji": "🇾🇪", "unicode": "U+1F1FE U+1F1EA"}, - "YT": {"emoji": "🇾🇹", "unicode": "U+1F1FE U+1F1F9"}, - "ZA": {"emoji": "🇿🇦", "unicode": "U+1F1FF U+1F1E6"}, - "ZM": {"emoji": "🇿🇲", "unicode": "U+1F1FF U+1F1F2"}, - "ZW": {"emoji": "🇿🇼", "unicode": "U+1F1FF U+1F1FC"} -} diff --git a/ipinfo/handler.py b/ipinfo/handler.py index 4b7ef6d..cbeca87 100644 --- a/ipinfo/handler.py +++ b/ipinfo/handler.py @@ -22,14 +22,17 @@ REQUEST_TIMEOUT_DEFAULT, BATCH_REQ_TIMEOUT_DEFAULT, cache_key, + read_json_file, ) from . import handler_utils from .bogon import is_bogon -from .continent import continents -from .countries import countries -from .currency import countries_currencies -from .eu import eu_countries -from .flags import countries_flags +from .data import ( + continents, + countries, + countries_currencies, + eu_countries, + countries_flags, +) class Handler: @@ -46,19 +49,25 @@ def __init__(self, access_token=None, **kwargs): self.access_token = access_token # load countries file - self.countries = countries + self.countries = read_json_file("countries_file.json", countries) # load eu countries file - self.eu_countries = eu_countries + self.eu_countries = read_json_file( + "eu_countries_file.json", eu_countries + ) # load countries flags file - self.countries_flags = countries_flags + self.countries_flags = read_json_file( + "countries_flags_file.json", countries_flags + ) # load countries currency file - self.countries_currencies = countries_currencies + self.countries_currencies = read_json_file( + "countries_currencies_file.json", countries_currencies + ) # load continent file - self.continents = continents + self.continents = read_json_file("continent_file.json", continents) # setup req opts self.request_options = kwargs.get("request_options", {}) diff --git a/ipinfo/handler_async.py b/ipinfo/handler_async.py index ec91a79..73a9503 100644 --- a/ipinfo/handler_async.py +++ b/ipinfo/handler_async.py @@ -23,14 +23,17 @@ REQUEST_TIMEOUT_DEFAULT, BATCH_REQ_TIMEOUT_DEFAULT, cache_key, + read_json_file, ) from . import handler_utils from .bogon import is_bogon -from .continent import continents -from .countries import countries -from .currency import countries_currencies -from .eu import eu_countries -from .flags import countries_flags +from .data import ( + continents, + countries, + countries_currencies, + eu_countries, + countries_flags, +) class AsyncHandler: @@ -47,19 +50,25 @@ def __init__(self, access_token=None, **kwargs): self.access_token = access_token # load countries file - self.countries = countries + self.countries = read_json_file("countries_file.json", countries) # load eu countries file - self.eu_countries = eu_countries + self.eu_countries = read_json_file( + "eu_countries_file.json", eu_countries + ) # load countries flags file - self.countries_flags = countries_flags + self.countries_flags = read_json_file( + "countries_flags_file.json", countries_flags + ) # load countries currency file - self.countries_currencies = countries_currencies + self.countries_currencies = read_json_file( + "countries_currencies_file.json", countries_currencies + ) # load continent file - self.continents = continents + self.continents = read_json_file("continent_file.json", continents) # setup req opts self.request_options = kwargs.get("request_options", {}) diff --git a/ipinfo/handler_utils.py b/ipinfo/handler_utils.py index 782dfa2..e882988 100644 --- a/ipinfo/handler_utils.py +++ b/ipinfo/handler_utils.py @@ -96,12 +96,14 @@ def read_coords(location): return lat, lon -def read_json_file(json_file): - json_file = os.path.join(os.path.dirname(__file__), json_file) - with open(json_file, encoding="utf8") as f: - json_data = f.read() - - return json.loads(json_data) +def read_json_file(json_file, default_value=None): + try: + json_file = os.path.join(os.path.dirname(__file__), json_file) + with open(json_file, encoding="utf8") as f: + json_data = f.read() + return json.loads(json_data) + except FileNotFoundError: + return default_value def return_or_fail(raise_on_fail, e, v): diff --git a/tests/handler_async_test.py b/tests/handler_async_test.py index 0de97e2..e8206cb 100644 --- a/tests/handler_async_test.py +++ b/tests/handler_async_test.py @@ -181,6 +181,7 @@ async def test_get_batch_details_total_timeout(batch_size): # BOGON TESTS ############# + @pytest.mark.asyncio async def test_bogon_details(): token = os.environ.get("IPINFO_TOKEN", "") From 352518bd1f4b3833b5b3602229177997c61b303e Mon Sep 17 00:00:00 2001 From: harisabdullah Date: Mon, 20 Nov 2023 19:22:52 +0500 Subject: [PATCH 03/15] Fixes --- ipinfo/handler.py | 10 +++++----- ipinfo/handler_async.py | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ipinfo/handler.py b/ipinfo/handler.py index cbeca87..f15ae2b 100644 --- a/ipinfo/handler.py +++ b/ipinfo/handler.py @@ -49,25 +49,25 @@ def __init__(self, access_token=None, **kwargs): self.access_token = access_token # load countries file - self.countries = read_json_file("countries_file.json", countries) + self.countries = read_json_file(kwargs.get("countries_file"), countries) # load eu countries file self.eu_countries = read_json_file( - "eu_countries_file.json", eu_countries + kwargs.get("eu_countries_file"), eu_countries ) # load countries flags file self.countries_flags = read_json_file( - "countries_flags_file.json", countries_flags + kwargs.get("countries_flags_file"), countries_flags ) # load countries currency file self.countries_currencies = read_json_file( - "countries_currencies_file.json", countries_currencies + kwargs.get("countries_currencies_file"), countries_currencies ) # load continent file - self.continents = read_json_file("continent_file.json", continents) + self.continents = read_json_file(kwargs.get("continent_file"), continents) # setup req opts self.request_options = kwargs.get("request_options", {}) diff --git a/ipinfo/handler_async.py b/ipinfo/handler_async.py index 73a9503..c62ea1f 100644 --- a/ipinfo/handler_async.py +++ b/ipinfo/handler_async.py @@ -50,25 +50,25 @@ def __init__(self, access_token=None, **kwargs): self.access_token = access_token # load countries file - self.countries = read_json_file("countries_file.json", countries) + self.countries = read_json_file(kwargs.get("countries_file"), countries) # load eu countries file self.eu_countries = read_json_file( - "eu_countries_file.json", eu_countries + kwargs.get("eu_countries_file"), eu_countries ) # load countries flags file self.countries_flags = read_json_file( - "countries_flags_file.json", countries_flags + kwargs.get("countries_flags_file"), countries_flags ) # load countries currency file self.countries_currencies = read_json_file( - "countries_currencies_file.json", countries_currencies + kwargs.get("countries_currencies_file"), countries_currencies ) # load continent file - self.continents = read_json_file("continent_file.json", continents) + self.continents = read_json_file(kwargs.get("continent_file"), continents) # setup req opts self.request_options = kwargs.get("request_options", {}) From 88cf8c5ac5d72a4d67032a91249cf1d7fdcb9424 Mon Sep 17 00:00:00 2001 From: harisabdullah Date: Mon, 20 Nov 2023 20:04:28 +0500 Subject: [PATCH 04/15] Fixes --- ipinfo/handler.py | 25 ++++++++++++++----------- ipinfo/handler_async.py | 22 ++++++++++++++-------- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/ipinfo/handler.py b/ipinfo/handler.py index f15ae2b..00e5328 100644 --- a/ipinfo/handler.py +++ b/ipinfo/handler.py @@ -3,9 +3,6 @@ """ from ipaddress import IPv4Address, IPv6Address -import json -import os -import sys import time import requests @@ -49,25 +46,31 @@ def __init__(self, access_token=None, **kwargs): self.access_token = access_token # load countries file - self.countries = read_json_file(kwargs.get("countries_file"), countries) + self.countries = ( + read_json_file(kwargs.get("countries_file")) or countries + ) # load eu countries file - self.eu_countries = read_json_file( - kwargs.get("eu_countries_file"), eu_countries + self.eu_countries = ( + read_json_file(kwargs.get("eu_countries_file")) or eu_countries ) # load countries flags file - self.countries_flags = read_json_file( - kwargs.get("countries_flags_file"), countries_flags + self.countries_flags = ( + read_json_file(kwargs.get("countries_flags_file")) + or countries_flags ) # load countries currency file - self.countries_currencies = read_json_file( - kwargs.get("countries_currencies_file"), countries_currencies + self.countries_currencies = ( + read_json_file(kwargs.get("countries_currencies_file")) + or countries_currencies ) # load continent file - self.continents = read_json_file(kwargs.get("continent_file"), continents) + self.continents = ( + read_json_file(kwargs.get("continent_file")) or continents + ) # setup req opts self.request_options = kwargs.get("request_options", {}) diff --git a/ipinfo/handler_async.py b/ipinfo/handler_async.py index c62ea1f..3406e44 100644 --- a/ipinfo/handler_async.py +++ b/ipinfo/handler_async.py @@ -50,25 +50,31 @@ def __init__(self, access_token=None, **kwargs): self.access_token = access_token # load countries file - self.countries = read_json_file(kwargs.get("countries_file"), countries) + self.countries = ( + read_json_file(kwargs.get("countries_file")) or countries + ) # load eu countries file - self.eu_countries = read_json_file( - kwargs.get("eu_countries_file"), eu_countries + self.eu_countries = ( + read_json_file(kwargs.get("eu_countries_file")) or eu_countries ) # load countries flags file - self.countries_flags = read_json_file( - kwargs.get("countries_flags_file"), countries_flags + self.countries_flags = ( + read_json_file(kwargs.get("countries_flags_file")) + or countries_flags ) # load countries currency file - self.countries_currencies = read_json_file( - kwargs.get("countries_currencies_file"), countries_currencies + self.countries_currencies = ( + read_json_file(kwargs.get("countries_currencies_file")) + or countries_currencies ) # load continent file - self.continents = read_json_file(kwargs.get("continent_file"), continents) + self.continents = ( + read_json_file(kwargs.get("continent_file")) or continents + ) # setup req opts self.request_options = kwargs.get("request_options", {}) From 60fdb9c1bfbae5bcc623e72c8dfbd7007f90cf33 Mon Sep 17 00:00:00 2001 From: harisabdullah Date: Mon, 20 Nov 2023 23:08:29 +0500 Subject: [PATCH 05/15] Fixes --- ipinfo/handler_utils.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ipinfo/handler_utils.py b/ipinfo/handler_utils.py index e882988..f787822 100644 --- a/ipinfo/handler_utils.py +++ b/ipinfo/handler_utils.py @@ -96,14 +96,19 @@ def read_coords(location): return lat, lon -def read_json_file(json_file, default_value=None): +def read_json_file(json_file): try: - json_file = os.path.join(os.path.dirname(__file__), json_file) - with open(json_file, encoding="utf8") as f: + if not json_file: + return None + json_file_path = os.path.join(os.path.dirname(__file__), json_file) + with open(json_file_path, encoding="utf8") as f: json_data = f.read() + if not json_data: + return None return json.loads(json_data) + except FileNotFoundError: - return default_value + return None def return_or_fail(raise_on_fail, e, v): From 81670c301f3b99ea4a67975a80ee3b8e786f5824 Mon Sep 17 00:00:00 2001 From: harisabdullah Date: Wed, 22 Nov 2023 14:22:01 +0500 Subject: [PATCH 06/15] Getting in memory maps from user rather than files --- ipinfo/handler.py | 20 +++++--------------- ipinfo/handler_async.py | 20 +++++--------------- 2 files changed, 10 insertions(+), 30 deletions(-) diff --git a/ipinfo/handler.py b/ipinfo/handler.py index 00e5328..64fed3f 100644 --- a/ipinfo/handler.py +++ b/ipinfo/handler.py @@ -46,31 +46,21 @@ def __init__(self, access_token=None, **kwargs): self.access_token = access_token # load countries file - self.countries = ( - read_json_file(kwargs.get("countries_file")) or countries - ) + self.countries = kwargs.get("countries") or countries # load eu countries file - self.eu_countries = ( - read_json_file(kwargs.get("eu_countries_file")) or eu_countries - ) + self.eu_countries = kwargs.get("eu_countries") or eu_countries # load countries flags file - self.countries_flags = ( - read_json_file(kwargs.get("countries_flags_file")) - or countries_flags - ) + self.countries_flags = kwargs.get("countries_flags") or countries_flags # load countries currency file self.countries_currencies = ( - read_json_file(kwargs.get("countries_currencies_file")) - or countries_currencies + kwargs.get("countries_currencies") or countries_currencies ) # load continent file - self.continents = ( - read_json_file(kwargs.get("continent_file")) or continents - ) + self.continents = kwargs.get("continent") or continents # setup req opts self.request_options = kwargs.get("request_options", {}) diff --git a/ipinfo/handler_async.py b/ipinfo/handler_async.py index 3406e44..07aed67 100644 --- a/ipinfo/handler_async.py +++ b/ipinfo/handler_async.py @@ -50,31 +50,21 @@ def __init__(self, access_token=None, **kwargs): self.access_token = access_token # load countries file - self.countries = ( - read_json_file(kwargs.get("countries_file")) or countries - ) + self.countries = kwargs.get("countries") or countries # load eu countries file - self.eu_countries = ( - read_json_file(kwargs.get("eu_countries_file")) or eu_countries - ) + self.eu_countries = kwargs.get("eu_countries") or eu_countries # load countries flags file - self.countries_flags = ( - read_json_file(kwargs.get("countries_flags_file")) - or countries_flags - ) + self.countries_flags = kwargs.get("countries_flags") or countries_flags # load countries currency file self.countries_currencies = ( - read_json_file(kwargs.get("countries_currencies_file")) - or countries_currencies + kwargs.get("countries_currencies") or countries_currencies ) # load continent file - self.continents = ( - read_json_file(kwargs.get("continent_file")) or continents - ) + self.continents = kwargs.get("continent") or continents # setup req opts self.request_options = kwargs.get("request_options", {}) From dc0f2c17d6b445ee409452d44c4dfcdd141a04a1 Mon Sep 17 00:00:00 2001 From: harisabdullah Date: Wed, 22 Nov 2023 15:18:28 +0500 Subject: [PATCH 07/15] Updated `README.md` --- README.md | 73 ++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 64 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 72f4aa4..71a5b04 100644 --- a/README.md +++ b/README.md @@ -240,20 +240,75 @@ You can add custom headers or modify default headers by setting the `headers` ke ### Internationalization -When looking up an IP address, the response object includes `details.country_name`, `details.isEU`, `details.country_flag`, `details.country_flag_url` and `details.country_currency` attributes which includes the country based on American English. It is possible to return the country name in other languages by setting the `countries_file`, remove or add EU countries by setting the keyword argument `eu_countries_file`, change the country flag emoji or unicode by setting the keyword argument `countries_flags_file` or change country's currency code or currency symbol by setting the `countries_currencies` when creating the `IPinfo` object. Moreover, the response object includes a `details.continent` which includes continent code and name of IP. The default file can be changed by setting the `continent_file` while creating the `IPinfo` object. +When looking up an IP address, the response object includes `details.country_name`, `details.isEU`, `details.country_flag`, `details.country_flag_url` and `details.country_currency` attributes which includes the country based on American English. It is possible to return the country name in other languages by setting the `countries`, remove or add EU countries by setting the keyword argument `eu_countries`, change the country flag emoji or unicode by setting the keyword argument `countries_flags` or change country's currency code or currency symbol by setting the `countries_currencies` when creating the `IPinfo` object. Moreover, the response object includes a `details.continent` which includes continent code and name of IP. The default file can be changed by setting the `continent` while creating the `IPinfo` object. -The file must be a `.json` file with the following structure: +```python +>>> import ipinfo +``` -```json -{ - "BD": {"name":"Bangladesh", "isEU":false}, - "BE": {"name":"Belgium", "isEU":true}, - "BF": {"name":"Burkina Faso", "isEU":false}, - "BG": {"name":"Bulgaria", "isEU":true}, - ... +#### Country Names (`countries`): +Set the countries keyword argument or provide an in-memory map to customize country names. +```python +>>> countries = { + "BD": "Bangladesh", + "BE": "Belgium", + "BF": "Burkina Faso", + ... } ``` +#### EU Countries (`eu_countries`): +Set the eu_countries keyword argument or provide an in-memory list to customize EU countries. +```python +>>> eu_countries = [ + "IE", + "AT", + "LT", + ... +] +``` +#### Country Flags (`countries_flags`): +Set the countries_flags keyword argument or provide an in-memory map to customize country flags. +```python +>>> countries_flags = { + "AD": {"emoji": "🇦🇩", "unicode": "U+1F1E6 U+1F1E9"}, + "AE": {"emoji": "🇦🇪", "unicode": "U+1F1E6 U+1F1EA"}, + "AF": {"emoji": "🇦🇫", "unicode": "U+1F1E6 U+1F1EB"}, + ... +} +``` +#### Country Currencies (`countries_currencies`): +Set the countries_currencies keyword argument or provide an in-memory map to customize country currencies. +```python +>>> countries_currencies = { + "AD": {"code": "EUR", "symbol": "€"}, + "AE": {"code": "AED", "symbol": "د.إ"}, + "AF": {"code": "AFN", "symbol": "؋"}, + ... +} +``` +#### Continents (`continents`): +Set the continents keyword argument or provide an in-memory map to customize continent details. +```python +>>> continents = { + "BD": {"code": "AS", "name": "Asia"}, + "BE": {"code": "EU", "name": "Europe"}, + "BF": {"code": "AF", "name": "Africa"}, + ... +} +``` +#### Usage: +```python +>>> access_token = '123456789abc' +>>> handler = ipinfo.getHandler( + access_token, + countries=countries, + eu_countries=eu_countries, + countries_flags=countries_flags, + countries_currencies=countries_currencies, + continents=continents +) +``` ### Batch Operations Looking up a single IP at a time can be slow. It could be done concurrently From 49d9c8cfacc963284adc634e13885cddab585576 Mon Sep 17 00:00:00 2001 From: harisabdullah Date: Wed, 22 Nov 2023 15:31:16 +0500 Subject: [PATCH 08/15] Updated `README.md` --- README.md | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 71a5b04..0eeac5b 100644 --- a/README.md +++ b/README.md @@ -246,8 +246,8 @@ When looking up an IP address, the response object includes `details.country_nam >>> import ipinfo ``` -#### Country Names (`countries`): -Set the countries keyword argument or provide an in-memory map to customize country names. +* Country Names (`countries`): +**In-memory list** to customize countries. ```python >>> countries = { "BD": "Bangladesh", @@ -256,9 +256,8 @@ Set the countries keyword argument or provide an in-memory map to customize coun ... } ``` -#### EU Countries (`eu_countries`): -Set the eu_countries keyword argument or provide an in-memory list to customize EU countries. - +* EU Countries (`eu_countries`): +**In-memory list** to customize EU countries. ```python >>> eu_countries = [ "IE", @@ -267,8 +266,8 @@ Set the eu_countries keyword argument or provide an in-memory list to customize ... ] ``` -#### Country Flags (`countries_flags`): -Set the countries_flags keyword argument or provide an in-memory map to customize country flags. +* Country Flags (`countries_flags`): +**In-memory map** to customize country flags. ```python >>> countries_flags = { "AD": {"emoji": "🇦🇩", "unicode": "U+1F1E6 U+1F1E9"}, @@ -277,8 +276,8 @@ Set the countries_flags keyword argument or provide an in-memory map to customiz ... } ``` -#### Country Currencies (`countries_currencies`): -Set the countries_currencies keyword argument or provide an in-memory map to customize country currencies. +* Country Currencies (`countries_currencies`): +**In-memory map** to customize country currencies. ```python >>> countries_currencies = { "AD": {"code": "EUR", "symbol": "€"}, @@ -287,8 +286,8 @@ Set the countries_currencies keyword argument or provide an in-memory map to cus ... } ``` -#### Continents (`continents`): -Set the continents keyword argument or provide an in-memory map to customize continent details. +* Continents (`continents`): +**In-memory map** to customize continents. ```python >>> continents = { "BD": {"code": "AS", "name": "Asia"}, From 5a48d364b653a9f78c5d12e2d06da34d4cf2123f Mon Sep 17 00:00:00 2001 From: harisabdullah Date: Wed, 22 Nov 2023 15:42:53 +0500 Subject: [PATCH 09/15] Updated `README.md` --- README.md | 48 +++++++++++++++++++----------------------------- 1 file changed, 19 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 0eeac5b..d39485b 100644 --- a/README.md +++ b/README.md @@ -245,55 +245,45 @@ When looking up an IP address, the response object includes `details.country_nam ```python >>> import ipinfo ``` - -* Country Names (`countries`): -**In-memory list** to customize countries. ```python ->>> countries = { +# Country Names (`countries`): In-memory map +countries = { "BD": "Bangladesh", "BE": "Belgium", "BF": "Burkina Faso", - ... + # ... } -``` -* EU Countries (`eu_countries`): -**In-memory list** to customize EU countries. -```python ->>> eu_countries = [ + +# EU Countries (`eu_countries`): In-memory list +eu_countries = [ "IE", "AT", "LT", - ... + # ... ] -``` -* Country Flags (`countries_flags`): -**In-memory map** to customize country flags. -```python ->>> countries_flags = { + +# Country Flags (`countries_flags`): In-memory map +countries_flags = { "AD": {"emoji": "🇦🇩", "unicode": "U+1F1E6 U+1F1E9"}, "AE": {"emoji": "🇦🇪", "unicode": "U+1F1E6 U+1F1EA"}, "AF": {"emoji": "🇦🇫", "unicode": "U+1F1E6 U+1F1EB"}, - ... + # ... } -``` -* Country Currencies (`countries_currencies`): -**In-memory map** to customize country currencies. -```python ->>> countries_currencies = { + +# Country Currencies (`countries_currencies`): In-memory map +countries_currencies = { "AD": {"code": "EUR", "symbol": "€"}, "AE": {"code": "AED", "symbol": "د.إ"}, "AF": {"code": "AFN", "symbol": "؋"}, - ... + # ... } -``` -* Continents (`continents`): -**In-memory map** to customize continents. -```python ->>> continents = { + +# Continents (`continents`): In-memory map +continents = { "BD": {"code": "AS", "name": "Asia"}, "BE": {"code": "EU", "name": "Europe"}, "BF": {"code": "AF", "name": "Africa"}, - ... + # ... } ``` #### Usage: From 394c7dfae920c574571e0bf745bffa6e69754b92 Mon Sep 17 00:00:00 2001 From: harisabdullah Date: Wed, 22 Nov 2023 15:45:27 +0500 Subject: [PATCH 10/15] Updated `README.md` --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index d39485b..8fed95f 100644 --- a/README.md +++ b/README.md @@ -246,40 +246,40 @@ When looking up an IP address, the response object includes `details.country_nam >>> import ipinfo ``` ```python -# Country Names (`countries`): In-memory map -countries = { +# Country Names: In-memory map +>>> countries = { "BD": "Bangladesh", "BE": "Belgium", "BF": "Burkina Faso", # ... } -# EU Countries (`eu_countries`): In-memory list -eu_countries = [ +# EU Countries: In-memory list +>>> eu_countries = [ "IE", "AT", "LT", # ... ] -# Country Flags (`countries_flags`): In-memory map -countries_flags = { +# Country Flags: In-memory map +>>> countries_flags = { "AD": {"emoji": "🇦🇩", "unicode": "U+1F1E6 U+1F1E9"}, "AE": {"emoji": "🇦🇪", "unicode": "U+1F1E6 U+1F1EA"}, "AF": {"emoji": "🇦🇫", "unicode": "U+1F1E6 U+1F1EB"}, # ... } -# Country Currencies (`countries_currencies`): In-memory map -countries_currencies = { +# Country Currencies: In-memory map +>>> countries_currencies = { "AD": {"code": "EUR", "symbol": "€"}, "AE": {"code": "AED", "symbol": "د.إ"}, "AF": {"code": "AFN", "symbol": "؋"}, # ... } -# Continents (`continents`): In-memory map -continents = { +# Continents: In-memory map +>>> continents = { "BD": {"code": "AS", "name": "Asia"}, "BE": {"code": "EU", "name": "Europe"}, "BF": {"code": "AF", "name": "Africa"}, From dee274a2db576627e1ef6852189c583c3e479077 Mon Sep 17 00:00:00 2001 From: harisabdullah Date: Wed, 22 Nov 2023 15:49:53 +0500 Subject: [PATCH 11/15] small fixes --- ipinfo/handler.py | 1 - ipinfo/handler_async.py | 1 - ipinfo/handler_utils.py | 17 +++++------------ 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/ipinfo/handler.py b/ipinfo/handler.py index 64fed3f..7f35702 100644 --- a/ipinfo/handler.py +++ b/ipinfo/handler.py @@ -19,7 +19,6 @@ REQUEST_TIMEOUT_DEFAULT, BATCH_REQ_TIMEOUT_DEFAULT, cache_key, - read_json_file, ) from . import handler_utils from .bogon import is_bogon diff --git a/ipinfo/handler_async.py b/ipinfo/handler_async.py index 07aed67..337ec2c 100644 --- a/ipinfo/handler_async.py +++ b/ipinfo/handler_async.py @@ -23,7 +23,6 @@ REQUEST_TIMEOUT_DEFAULT, BATCH_REQ_TIMEOUT_DEFAULT, cache_key, - read_json_file, ) from . import handler_utils from .bogon import is_bogon diff --git a/ipinfo/handler_utils.py b/ipinfo/handler_utils.py index f787822..782dfa2 100644 --- a/ipinfo/handler_utils.py +++ b/ipinfo/handler_utils.py @@ -97,18 +97,11 @@ def read_coords(location): def read_json_file(json_file): - try: - if not json_file: - return None - json_file_path = os.path.join(os.path.dirname(__file__), json_file) - with open(json_file_path, encoding="utf8") as f: - json_data = f.read() - if not json_data: - return None - return json.loads(json_data) - - except FileNotFoundError: - return None + json_file = os.path.join(os.path.dirname(__file__), json_file) + with open(json_file, encoding="utf8") as f: + json_data = f.read() + + return json.loads(json_data) def return_or_fail(raise_on_fail, e, v): From a372bc0d8876214bb74092e352db27186ea55144 Mon Sep 17 00:00:00 2001 From: harisabdullah Date: Wed, 22 Nov 2023 15:52:11 +0500 Subject: [PATCH 12/15] small fixes --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 8fed95f..c336fe0 100644 --- a/README.md +++ b/README.md @@ -251,7 +251,7 @@ When looking up an IP address, the response object includes `details.country_nam "BD": "Bangladesh", "BE": "Belgium", "BF": "Burkina Faso", - # ... + ... } # EU Countries: In-memory list @@ -259,7 +259,7 @@ When looking up an IP address, the response object includes `details.country_nam "IE", "AT", "LT", - # ... + ... ] # Country Flags: In-memory map @@ -267,7 +267,7 @@ When looking up an IP address, the response object includes `details.country_nam "AD": {"emoji": "🇦🇩", "unicode": "U+1F1E6 U+1F1E9"}, "AE": {"emoji": "🇦🇪", "unicode": "U+1F1E6 U+1F1EA"}, "AF": {"emoji": "🇦🇫", "unicode": "U+1F1E6 U+1F1EB"}, - # ... + ... } # Country Currencies: In-memory map @@ -275,7 +275,7 @@ When looking up an IP address, the response object includes `details.country_nam "AD": {"code": "EUR", "symbol": "€"}, "AE": {"code": "AED", "symbol": "د.إ"}, "AF": {"code": "AFN", "symbol": "؋"}, - # ... + ... } # Continents: In-memory map @@ -283,7 +283,7 @@ When looking up an IP address, the response object includes `details.country_nam "BD": {"code": "AS", "name": "Asia"}, "BE": {"code": "EU", "name": "Europe"}, "BF": {"code": "AF", "name": "Africa"}, - # ... + ... } ``` #### Usage: From 74bc53d8dbce15984877f3b0ad0f97333bc07b79 Mon Sep 17 00:00:00 2001 From: harisabdullah Date: Wed, 22 Nov 2023 16:01:06 +0500 Subject: [PATCH 13/15] unused imports --- ipinfo/handler_async.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/ipinfo/handler_async.py b/ipinfo/handler_async.py index 337ec2c..52284ef 100644 --- a/ipinfo/handler_async.py +++ b/ipinfo/handler_async.py @@ -5,8 +5,6 @@ from ipaddress import IPv4Address, IPv6Address import asyncio import json -import os -import sys import time import aiohttp From 932d0ad8ee20a996cddeb48cb1d5f8ec00a3656a Mon Sep 17 00:00:00 2001 From: Uman Shahzad Date: Thu, 23 Nov 2023 16:44:31 +0500 Subject: [PATCH 14/15] Update README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index c336fe0..1a08b1f 100644 --- a/README.md +++ b/README.md @@ -244,8 +244,6 @@ When looking up an IP address, the response object includes `details.country_nam ```python >>> import ipinfo -``` -```python # Country Names: In-memory map >>> countries = { "BD": "Bangladesh", From 9f82db4823083b7fdd4de6e6e5a11fceb34a5222 Mon Sep 17 00:00:00 2001 From: Uman Shahzad Date: Thu, 23 Nov 2023 16:44:37 +0500 Subject: [PATCH 15/15] Update README.md --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1a08b1f..5c3cbe7 100644 --- a/README.md +++ b/README.md @@ -283,9 +283,8 @@ When looking up an IP address, the response object includes `details.country_nam "BF": {"code": "AF", "name": "Africa"}, ... } -``` -#### Usage: -```python + +# create handler >>> access_token = '123456789abc' >>> handler = ipinfo.getHandler( access_token,