lukes / iso-3166-countries-with-regional-codes Goto Github PK
View Code? Open in Web Editor NEWISO 3166-1 country lists merged with their UN Geoscheme regional codes in ready-to-use JSON, XML, CSV data sets
License: Other
ISO 3166-1 country lists merged with their UN Geoscheme regional codes in ready-to-use JSON, XML, CSV data sets
License: Other
I found that Vietnam is spelled as Viet Nam
Researching it Vietnam is the western/English spelling and Việt Nam not Viet Nam the Vietnamese spelling
Happy to change this manually in all files if wanted?
Firstly, thanks for a great repo and thanks for keeping it up to date and accurate.
Now the news: King Mswati III of Swaziland has announced that he is renaming the country "the Kingdom of eSwatini" - he's been calling it that for years apparently.
More info here:
http://www.bbc.com/news/world-africa-43821512
Happy to submit a pull request if you need help updating but I see you like to do this yourself with previous changes.
Hello, what’s the license under which scrubber.rb
is released?
The country Vietnam has a space in its name
Thank you for this handy reference for the ISO countries. I ran into conflict with the key names not matching ISO's key names. ISO uses Alpha-2, Alpha-3, Numeric in displays and discussions. In their CSV sample files, the headings are alpha_2_code, alpha_3_code, numeric_code.
It would be a breaking change to rename them, but I just wanted to note it. It came up when doing the variable names in our project.
(We're going with Alpha2, Alpha3, Numeric; translating from your files; and avoiding ISO's kebab-case.)
Somewhat related to the hyphen question #27
See #3
see topic
Hi!
At first, thank you for this repo!
In your readme you say that you have updated the data to August 2016.
I cant find this update in this repo.
Please help.
Thanks!
Can i found somewhere a repository with a list of ISO 3166 states ?
Here is what i complete for now, for a PHP Laravel library, but that very very long to parse and add data from wikipedia.
https://fr.wikipedia.org/wiki/ISO_3166-2:CA
https://fr.wikipedia.org/wiki/ISO_3166-2:US
https://fr.wikipedia.org/wiki/ISO_3166-2:MX
https://fr.wikipedia.org/wiki/ISO_3166-2:FR
Please Update the list
As the question said, isn's it supposed to be that way if written in English?
Thank u for replying!
I think that Cyprus is listed at a wrong region.
It´s listed at Asia, but I thinj it shoud be Europe
please change "flag-ioc-sin" to "flag-ioc-sgp" or add "flag-ioc-sgp".
Thank you very much!
Hello,
First of all, I want to thank you for this list. I am not an English native speaker, and I am wondering the reason you call the region 'Americas' instead of 'America'.
This dataset is very useful, and I thought you might would like to regulate its use using a license. I suggest using CC-BY-SA 4.0 since you build your works upon Wikipedia's dataset which use CC-BY-SA 3.0 as its license.
(Actually, I had just realized that your repo also contains a Ruby script to retrieve the data, but I assumed you primarily use this repo to share your datasets and not your script).
Just FYI, heres another potential source: https://www.cia.gov/library/publications/the-world-factbook/appendix/appendix-d.html
I don't know how accurate and up-to-date it is, though.
Using a hyphen in the object key names doesn't play very well with JavaScript and other languages. Please consider using underscores or camelCase.
Hi, appreciate for the great work, but Taiwan does not belong to Province of China right now, since there's still an independent form of government in Taiwan and people from China cannot enter Taiwan without passport or any VISA.
This is a controversial issue for a long time, and it is not settled until now, so I'll be appreciate if you can change the name of this place to Taiwan, which is the name that most of the people live in this place think it should be.
Thank you.
African intermediate region "middle Africa" name used in this dataset is generally "central Africa"
Could you please add the Netherlands Antilles into the list?
I implemented a code generator for C++11 in Python. If you're at all interested in merging this back into your repo I'm happy to tidy it up some more and take your guidance on it.
Thanks for the super-convenient JSON! 👍
-- Nigel
#!/bin/getenv python
import json
import codecs
input = codecs.open("all/all.json", 'r', 'UTF-8')
h = codecs.open("all/all.h", 'w', 'UTF-8')
cpp = codecs.open("all/all.cpp", 'w', 'UTF-8')
dom = json.load(input)
h.write('''
#pragma once
#include <string>
struct Country
{
std::string name;
std::string alpha_2;
std::string alpha_3;
std::string country_code;
std::string region_code;
std::string region;
std::string sub_region;
};
const Country * findByName (const std::string &);
const Country * findByAlpha2(const std::string &);
const Country * findByAlpha3(const std::string &);
const Country * findByCode (const std::string &);
''')
cpp.write('''
#include "all.h"
#include <map>
''')
cpp.write("const Country country[%d] = {\n" % len(dom))
for i in dom:
cpp.write(' { "%s", "%s", "%s", "%s", "%s", "%s", "%s" },\n'%(i["name"], i["alpha-2"], i["alpha-3"], i["country-code"], i["region-code"], i["region"], i["sub-region"]))
cpp.write("};\n\n");
cpp.write("const std::map<std::string, const Country *> countryByName = {\n" )
index = 0;
for i in dom:
cpp.write(' { "%s", &country[%d] },\n'%(i["name"], index))
index = index + 1
cpp.write("};\n\n")
cpp.write("const std::map<std::string, const Country *> countryByAlpha2 = {\n" )
index = 0;
for i in dom:
cpp.write(' { "%s", &country[%d] },\n'%(i["alpha-2"], index))
index = index + 1
cpp.write("};\n\n")
cpp.write("const std::map<std::string, const Country *> countryByAlpha3 = {\n" )
index = 0;
for i in dom:
cpp.write(' { "%s", &country[%d] },\n'%(i["alpha-3"], index))
index = index + 1
cpp.write("};\n\n")
cpp.write("const std::map<std::string, const Country *> countryByCode = {\n" )
index = 0;
for i in dom:
cpp.write(' { "%s", &country[%d] },\n'%(i["country-code"], index))
index = index + 1
cpp.write("};\n\n")
cpp.write("""
const Country * findByName(const std::string & name)
{
auto i = countryByName.find(name);
return i==countryByName.end() ? NULL : i->second;
}
const Country * findByAlpha2(const std::string & name)
{
auto i = countryByAlpha2.find(name);
return i==countryByAlpha2.end() ? NULL : i->second;
}
const Country * findByAlpha3(const std::string & name)
{
auto i = countryByAlpha3.find(name);
return i==countryByAlpha3.end() ? NULL : i->second;
}
const Country * findByCode(const std::string & name)
{
auto i = countryByCode.find(name);
return i==countryByCode.end() ? NULL : i->second;
}
""")
Some country name is strange, looks like it's been chuncated. I think the name should be more human readable.
For Example, Korea (Democratic People's Republic of)
should be full nameKorea (Democratic People's Republic of Korea)
or common name North Korea
.
$ cat all.json | jq ".[].name" | grep of
"Bolivia (Plurinational State of)"
"Congo, Democratic Republic of the"
"Iran (Islamic Republic of)"
"Isle of Man"
"Korea (Democratic People's Republic of)"
"Korea, Republic of"
"Micronesia (Federated States of)"
"Moldova, Republic of"
"Palestine, State of"
"Taiwan, Province of China"
"Tanzania, United Republic of"
"United Kingdom of Great Britain and Northern Ireland"
"United States of America"
"Venezuela (Bolivarian Republic of)"
Hello,
ISO 3166 defines countries in the usual sense and some of their subdivisions. However there is no link between a subdivision and the "main" entity. For instance:
MQ
) is usually understood as linked to France (FR
)GL
) is usually understood as linked to Denmark (DK
)Therefore I think it might be a good idea to add a column to store that information. I understand it might be a tricky issue (it's probably why the ISO doesn't do that) but I find this useful. We should probably pay attention to the chosen terms.
Any thoughts ?
P.S.: thanks for this useful list.
Sorry for asking in the issues, I really don't know where else to look for this information, and I can't find it on the web either.
Are country-code
expected to be constant? I know country names and 2-letter codes can change (eg FYROM MK soon) but will the numeric codes in this repo's CSVs remain constant nomatter what? Can I safely use those as primary keys, to refer to countries from other tables? And keep your CSV updated in my app, without fear of inconsistency in my app in the future? (except for when two countries join, and a numeric code then disappears)
Thanks.
I noticed that Kosovo (XK) is missing.
There is no mention of license in the code. A general license type of MIT or GPL will be useful to include
I'd like to review the code in here and perhaps use the data, could you please inform me of the license you have published this under.
Thanks for the useful resource. There's a small bug with two of the countries: St Kitts and Nevis and Serbia - their value for sub-region-code
is actually their country code - e.g. 688 for Serbia, when it should be 039 (Southern Europe). All the others appear fine.
Hello,
I'd like to know if you were interested into a PR which would add a package.json
file in order to publish to the node package manager registry.
This would allow people to use the json (and other formats, but mostly json) directly from their dependencies in any javascript project.
I'd be happy to help on that, let me know.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.