Coder Social home page Coder Social logo

mledoze / countries Goto Github PK

View Code? Open in Web Editor NEW
5.9K 160.0 1.3K 28.3 MB

World countries in JSON, CSV, XML and Yaml. Any help is welcome!

Home Page: https://mledoze.github.io/countries/

License: Open Data Commons Open Database License v1.0

PHP 99.56% JavaScript 0.44%
countries geojson topojson xml csv yaml json php

countries's Introduction

World countries in JSON, CSV, XML and YAML.

License Build Status

Latest Stable Version npm downloads

Latest Stable Version PHP from Packagist Packagist downloads

Countries data

This repository contains a list of world countries, as defined by ISO Standard 3166-1, in JSON, CSV, XML and YAML. Warning: not all entities in this project are independent countries; refer to the independent property to know if the country is considered a sovereign state.

Each line contains the country:

  • name
    • common - common name in english
    • official - official name in english
    • native - list of all native names
      • key: three-letter ISO 639-3 language code
      • value: name object
        • key: official - official name translation
        • key: common - common name translation
  • country code top-level domain (tld)
  • code ISO 3166-1 alpha-2 (cca2)
  • code ISO 3166-1 numeric (ccn3)
  • code ISO 3166-1 alpha-3 (cca3)
  • code International Olympic Committee (cioc)
  • ISO 3166-1 independence status (independent) (denotes the country is considered a sovereign state)
  • ISO 3166-1 assignment status (status)
  • UN Member status (unMember)
  • currencies - list of all currencies
    • key: ISO 4217 currency code
    • value: currency object
      • key: name name of the currency
      • key: symbol symbol of the currency
  • International Direct Dialing info (idd)
    • root - the root geographical code prefix. e.g. +6 for New Zealand, +4 for UK.
    • suffixes - list of all suffixes assigned to this country. 4 for NZ, 809, 829, and 849 for Dominican Republic.
  • capital city(ies) (capital)
  • alternative spellings (altSpellings)
  • region
  • subregion
  • list of official languages (languages)
    • key: three-letter ISO 639-3 language code
    • value: name of the language in english
  • list of name translations (translations)
    • key: three-letter ISO 639-3 language code
    • value: name object
      • key: official - official name translation
      • key: common - common name translation
  • latitude and longitude (latlng)
  • demonyms - name of residents, translated & genderized
    • key: three-letter ISO 639-3 language code
    • value: genderized demonym object
      • key: f (female) or m (male)
      • value: genderized demonym translation
  • landlocked status (landlocked)
  • land borders (borders)
  • land area in km² (area)
  • Emoji flag (flag)
  • calling codes (callingCodes)

Additional data

The data folder contains additional data such as the countries GeoJSON outlines and flags in SVG format.

Examples

JSON
{
	"name": {
		"common": "Austria",
		"official": "Republic of Austria",
		"native": {
			"bar": {
				"official": "Republik Österreich",
				"common": "Österreich"
			}
		}
	},
	"tld": [".at"],
	"cca2": "AT",
	"ccn3": "040",
	"cca3": "AUT",
	"cioc": "AUT",
	"independent": true,
	"status": "officially-assigned",
	"unMember": true,
	"currencies": {"EUR": {"name": "Euro", "symbol": "\u20ac"}},
	"idd": {
		"root": "+4",
		"suffixes": ["3"]
	},
	"capital": ["Vienna"],
	"altSpellings": ["AT", "Osterreich", "Oesterreich"],
	"region": "Europe",
	"subregion": "Western Europe",
	"languages": {
		"bar": "Austro-Bavarian German"
	},
	"translations": {
		"cym": {"official": "Republic of Austria", "common": "Awstria"},
		"deu": {"official": "Republik Österreich", "common": "Österreich"},
		"fra": {"official": "République d'Autriche", "common": "Autriche"},
		"hrv": {"official": "Republika Austrija", "common": "Austrija"},
		"ita": {"official": "Repubblica d'Austria", "common": "Austria"},
		"jpn": {"official": "オーストリア共和国", "common": "オーストリア"},
		"nld": {"official": "Republiek Oostenrijk", "common": "Oostenrijk"},
		"por": {"official": "República da Áustria", "common": "Áustria"},
		"rus": {"official": "Австрийская Республика", "common": "Австрия"},
		"spa": {"official": "República de Austria", "common": "Austria"}
	},
	"latlng": [47.33333333, 13.33333333],
	"demonyms": {
		"fra": {
			"f": "Autrichienne",
			"m": "Autrichien"
		},
		"spa": {
			"f": "Austriaco",
			"m": "Austriaca"
		}
	},
	"landlocked": true,
	"borders": ["CZE", "DEU", "HUN", "ITA", "LIE", "SVK", "SVN", "CHE"],
	"area": 83871,
	"callingCodes": ["+43"]
	"flag": "\ud83c\udde6\ud83c\uddf9"
}
GeoJSON and TopoJSON outlines

See an example for Germany: GeoJSON or TopoJSON.

CSV
"name";"tld";"cca2";"ccn3";"cca3";"cioc";"currency";"idd";"capital";"altSpellings";"region";"subregion";"languages";"translations";"latlng";"demonym";"landlocked";"borders";"area"
⋮
"Aruba,Aruba,Aruba,Aruba,Aruba,Aruba";".aw";"AW";"533";"ABW";"ARU";"AWG";"+2,97";"Oranjestad";"AW";"Americas";"Caribbean";"Dutch,Papiamento";"Aruba,Aruba,Aruba,Aruba,Aruba,Aruba,Aruba,Aruba,Aruba,Aruba,アルバ,アルバ,Aruba,Aruba,Aruba,Aruba,Аруба,Аруба,Aruba,Aruba";"12.5,-69.96666666";"Aruban";"";"";"180"
"Afghanistan,Islamic Republic of Afghanistan,جمهوری اسلامی افغانستان,افغانستان,د افغانستان اسلامي جمهوریت,افغانستان,Owganystan Yslam Respublikasy,Owganystan";".af";"AF";"004";"AFG";"AFG";"AFN";"+9,3";"Kabul";"AF,Afġānistān";"Asia";"Southern Asia";"Dari,Pashto,Turkmen";"Islamic Republic of Afghanistan,Affganistan,Islamischen Republik Afghanistan,Afghanistan,Afganistanin islamilainen tasavalta,Afganistan,République islamique d'Afghanistan,Afghanistan,Islamska Republika Afganistan,Afganistan,Repubblica islamica dell'Afghanistan,Afghanistan,アフガニスタン·イスラム共和国,アフガニスタン,Islamitische Republiek Afghanistan,Afghanistan,República Islâmica do Afeganistão,Afeganistão,Исламская Республика Афганистан,Афганистан,República Islámica de Afganistán,Afganistán";"33,65";"Afghan";"1";"IRN,PAK,TKM,UZB,TJK,CHN";"652230"
"Angola,Republic of Angola,República de Angola,Angola";".ao";"AO";"024";"AGO";"ANG";"AOA";"+2,44";"Luanda";"AO,República de Angola,ʁɛpublika de an'ɡɔla";"Africa";"Middle Africa";"Portuguese";"Republic of Angola,Angola,Republik Angola,Angola,Angolan tasavalta,Angola,République d'Angola,Angola,Republika Angola,Angola,Repubblica dell'Angola,Angola,アンゴラ共和国,アンゴラ,Republiek Angola,Angola,República de Angola,Angola,Республика Ангола,Ангола,República de Angola,Angola";"-12.5,18.5";"Angolan";"";"COG,COD,ZMB,NAM";"1246700"
⋮
XML
<?xml version="1.0" encoding="UTF-8"?>
<countries>
  <country name="Aruba,Aruba,Aruba,Aruba,Aruba,Aruba" tld=".aw" cca2="AW" ccn3="533" cca3="ABW" cioc="ARU" currency="AWG" idd="+2,97" capital="Oranjestad" altSpellings="AW" region="Americas" subregion="Caribbean" languages="Dutch,Papiamento" translations="Aruba,Aruba,Aruba,Aruba,Aruba,Aruba,Aruba,Aruba,Aruba,Aruba,アルバ,アルバ,Aruba,Aruba,Aruba,Aruba,Аруба,Аруба,Aruba,Aruba" latlng="12.5,-69.96666666" demonym="Aruban" landlocked="" borders="" area="180"/>
  <country name="Afghanistan,Islamic Republic of Afghanistan,جمهوری اسلامی افغانستان,افغانستان,د افغانستان اسلامي جمهوریت,افغانستان,Owganystan Yslam Respublikasy,Owganystan" tld=".af" cca2="AF" ccn3="004" cca3="AFG" cioc="AFG" currency="AFN" idd="+9,3" capital="Kabul" altSpellings="AF,Afġānistān" region="Asia" subregion="Southern Asia" languages="Dari,Pashto,Turkmen" translations="Islamic Republic of Afghanistan,Affganistan,Islamischen Republik Afghanistan,Afghanistan,Afganistanin islamilainen tasavalta,Afganistan,République islamique d'Afghanistan,Afghanistan,Islamska Republika Afganistan,Afganistan,Repubblica islamica dell'Afghanistan,Afghanistan,アフガニスタン·イスラム共和国,アフガニスタン,Islamitische Republiek Afghanistan,Afghanistan,República Islâmica do Afeganistão,Afeganistão,Исламская Республика Афганистан,Афганистан,República Islámica de Afganistán,Afganistán" latlng="33,65" demonym="Afghan" landlocked="1" borders="IRN,PAK,TKM,UZB,TJK,CHN" area="652230"/>
  <country name="Angola,Republic of Angola,República de Angola,Angola" tld=".ao" cca2="AO" ccn3="024" cca3="AGO" cioc="ANG" currency="AOA" idd="+2,44" capital="Luanda" altSpellings="AO,República de Angola,ʁɛpublika de an'ɡɔla" region="Africa" subregion="Middle Africa" languages="Portuguese" translations="Republic of Angola,Angola,Republik Angola,Angola,Angolan tasavalta,Angola,République d'Angola,Angola,Republika Angola,Angola,Repubblica dell'Angola,Angola,アンゴラ共和国,アンゴラ,Republiek Angola,Angola,República de Angola,Angola,Республика Ангола,Ангола,República de Angola,Angola" latlng="-12.5,18.5" demonym="Angolan" landlocked="" borders="COG,COD,ZMB,NAM" area="1246700"/>
⋮
<countries>
YAML
- { name: { common: Aruba, official: Aruba, native: { nld: { official: Aruba, common: Aruba }, pap: { official: Aruba, common: Aruba } } }, tld: [.aw], cca2: AW, ccn3: '533', cca3: ABW, cioc: ARU, currency: [AWG], idd: { root: '+2', suffixes: ['97'] }, capital: Oranjestad, altSpellings: [AW], region: Americas, subregion: Caribbean, languages: { nld: Dutch, pap: Papiamento }, translations: { deu: { official: Aruba, common: Aruba }, fin: { official: Aruba, common: Aruba }, fra: { official: Aruba, common: Aruba }, hrv: { official: Aruba, common: Aruba }, ita: { official: Aruba, common: Aruba }, jpn: { official: アルバ, common: アルバ }, nld: { official: Aruba, common: Aruba }, por: { official: Aruba, common: Aruba }, rus: { official: Аруба, common: Аруба }, spa: { official: Aruba, common: Aruba } }, latlng: [12.5, -69.96666666], demonym: Aruban, landlocked: false, borders: {  }, area: 180 }
- { name: { common: Afghanistan, official: 'Islamic Republic of Afghanistan', native: { prs: { official: 'جمهوری اسلامی افغانستان', common: افغانستان }, pus: { official: 'د افغانستان اسلامي جمهوریت', common: افغانستان }, tuk: { official: 'Owganystan Yslam Respublikasy', common: Owganystan } } }, tld: [.af], cca2: AF, ccn3: '004', cca3: AFG, cioc: AFG, currency: [AFN], idd: { root: '+9', suffixes: ['3'] }, capital: Kabul, altSpellings: [AF, Afġānistān], region: Asia, subregion: 'Southern Asia', languages: { prs: Dari, pus: Pashto, tuk: Turkmen }, translations: { cym: { official: 'Islamic Republic of Afghanistan', common: Affganistan }, deu: { official: 'Islamischen Republik Afghanistan', common: Afghanistan }, fin: { official: 'Afganistanin islamilainen tasavalta', common: Afganistan }, fra: { official: 'République islamique d''Afghanistan', common: Afghanistan }, hrv: { official: 'Islamska Republika Afganistan', common: Afganistan }, ita: { official: 'Repubblica islamica dell''Afghanistan', common: Afghanistan }, jpn: { official: アフガニスタン·イスラム共和国, common: アフガニスタン }, nld: { official: 'Islamitische Republiek Afghanistan', common: Afghanistan }, por: { official: 'República Islâmica do Afeganistão', common: Afeganistão }, rus: { official: 'Исламская Республика Афганистан', common: Афганистан }, spa: { official: 'República Islámica de Afganistán', common: Afganistán } }, latlng: [33, 65], demonym: Afghan, landlocked: true, borders: [IRN, PAK, TKM, UZB, TJK, CHN], area: 652230 }
- { name: { common: Angola, official: 'Republic of Angola', native: { por: { official: 'República de Angola', common: Angola } } }, tld: [.ao], cca2: AO, ccn3: '024', cca3: AGO, cioc: ANG, currency: [AOA], idd: { root: '+2', suffixes: ['44'] }, capital: Luanda, altSpellings: [AO, 'República de Angola', 'ʁɛpublika de an''ɡɔla'], region: Africa, subregion: 'Middle Africa', languages: { por: Portuguese }, translations: { cym: { official: 'Republic of Angola', common: Angola }, deu: { official: 'Republik Angola', common: Angola }, fin: { official: 'Angolan tasavalta', common: Angola }, fra: { official: 'République d''Angola', common: Angola }, hrv: { official: 'Republika Angola', common: Angola }, ita: { official: 'Repubblica dell''Angola', common: Angola }, jpn: { official: アンゴラ共和国, common: アンゴラ }, nld: { official: 'Republiek Angola', common: Angola }, por: { official: 'República de Angola', common: Angola }, rus: { official: 'Республика Ангола', common: Ангола }, spa: { official: 'República de Angola', common: Angola } }, latlng: [-12.5, 18.5], demonym: Angolan, landlocked: false, borders: [COG, COD, ZMB, NAM], area: 1246700 }

Customising the output

The data files provided in the dist directory include all available fields, but is also possible to build a custom version of the data with certain fields excluded.

To do this, you will first need a working PHP installation, composer and a local copy of this repository. Once you have these, open a terminal in your local version of this project's root directory and run this command to install the necessary dependencies:

composer install

After this finishes, run the following command (here we will exclude the tld field from the output, but you can exclude any field you want):

php countries.php convert --exclude-field=tld

You can also exclude multiple fields:

php countries.php convert --exclude-field=tld --exclude-field=cca2

# Or using the shorter `-x` syntax:
php countries.php convert -x tld -x cca2

If you prefer to include only some fields (this can not be combined with --exclude-field):

php countries.php convert --include-field=name --include-field=area

# or using the shorter `-i` syntax:
php countries.php convert -i name -i area

The generated files are put into the dist directory, but you can change this to another existing directory:

mkdir foobar
php countries.php convert --output-dir=foobar

You can also choose to only generate some of the output formats:

mkdir foobar
php countries.php convert --format=json_unescaped --format=csv

# or using the shorter `-f` syntax:
php countries.php convert -f json_unescaped -f csv

Showcase

Projects using this dataset:

How to contribute?

Please refer to CONTRIBUTING.

To do

  • add the type of the country (country, sovereign state, public body, territory, etc.)
  • pull in data automatically from CLDR at build time (idea from @Munter, see #108)

Sources

https://www.currency-iso.org/ for currency codes.

Region and subregion are taken from https://github.com/hexorx/countries.

GeoJSON outlines come from http://thematicmapping.org/downloads/world_borders.php.

The rest comes from Wikipedia.

Credits

Thanks to:

License

See LICENSE.

Flags are not licensed under the ODbL license; see https://en.wikipedia.org/wiki/Wikipedia:Copyright_on_emblems for more information.

countries's People

Contributors

alexsegura avatar alxnull avatar blacksmoke26 avatar blumk avatar cedric-anne avatar dependabot[bot] avatar emilv avatar fayderflorez avatar herrjemand avatar hinell avatar jamespwilliams avatar jremes-foss avatar marnusw avatar martinheidegger avatar michalvavra avatar mledoze avatar nabela avatar oscerd avatar paulvollmer avatar petert82 avatar ricardograca avatar robindaumann avatar soungrong avatar stephenpaulger avatar stevep-arm avatar ted451 avatar thachhoang avatar thevuong avatar twmbx avatar willettk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

countries's Issues

MySql/MongoDB extension for this solution

Hi, I think it would be great to have some solution where would be option also to import this into mysql, mongodb,..? File is already getting bigger, and bigger. I know there are other projects free and commercial where you could get this kind a data, but just giving a suggestion!

Other languages for Spain

Hello, can you adding the other official languages to spain country?

gl for Galego
eu for Euskera
ca for Catalan
oc for Occitan

Thanks

Extended language codes (IETF language tag)

Maybe it's a good idea to add the extended language codes? This is especially neat if you're going to use this datasource in combination with browsersniffing.

For example in Belgium you now have "nl" and "fr" (apparently also "de", which is new to me). But browsers sometimes show up as "nl-be" or "fr-be". (Or sometimes spelled nl_BE, fr_BE etc) Where in the Netherlands it's "nl-nl".

http://en.wikipedia.org/wiki/IETF_language_tag

Relevance and state names

Hi! Is there a reason why most states have relevance = 0 while smaller states with the same phone code as bigger ones (e.g. Andorra) have relevance = 0.5? Unless I've misunderstood the usage of this parameter, I'd suggest to change the relevance value from 0 to 1.

On a side note: would it be sensible to keep the names of the states as pure ASCII rather than UTF-8?

Nicola

countries.php need help

I've just done modification to json as proposed by @mledoze and countries.php does not want to work. Here is what I get:

PHP Notice:  Array to string conversion in .../countries/countries.php on line 96

here is json:

[
    {
        "altSpellings": [
            "AF",
            "Af\u0121\u0101nist\u0101n"
        ],
        "area": 652230,
        "borders": [
            "IRN",
            "PAK",
            "TKM",
            "UZB",
            "TJK",
            "CHN"
        ],
        "callingCode": [
            "93"
        ],
        "capital": "Kabul",
        "cca2": "AF",
        "cca3": "AFG",
        "ccn3": "004",
        "currency": [
            "AFN"
        ],
        "demonym": "Afghan",
        "language": [
            "Pashto",
            "Dari"
        ],
        "languageCodes": [
            "ps",
            "uz",
            "tk"
        ],
        "latlng": [
            33,
            65
        ],
        "name": {
            "common": "Afghanistan",
            "native": {
                "common": "\u0627\u0641\u063a\u0627\u0646\u0633\u062a\u0627\u0646",
                "official": ""
            },
            "official": ""
        },
        "region": "Asia",
        "relevance": "0",
        "subregion": "Southern Asia",
        "tld": [
            ".af"
        ],
        "translations": {
            "cy": "Affganistan",
            "de": "Afghanistan",
            "es": "Afganist\u00e1n",
            "fr": "Afghanistan",
            "hr": "Afganistan",
            "it": "Afghanistan",
            "ja": "\u30a2\u30d5\u30ac\u30cb\u30b9\u30bf\u30f3",
            "nl": "Afghanistan",
            "ru": "\u0410\u0444\u0433\u0430\u043d\u0438\u0441\u0442\u0430\u043d"
        }
    },...

master file + build script

For making sure data is consistent, it would be helpful to have all data in one master file and then generate the other formats using one or more build scripts. This way people can contribute data easier (no more editing thre separate files).

This would it also make very simple to provide scripts to generate even more output formats (eg. a MySQL dump file).

Language codes for Norway

Should be nb (Norwegian bokmål) and nn (Norwegian nynorsk). no was used previously for both languages so should perhaps also be retained.

Proposal: remove some entries

After further thinking about #57 and #77, I would like to propose the removal of the following entries, so that each entry in the dataset represent only one entity:

  • Saint Helena, Ascension and Tristan da Cunha (group of islands)
  • Bonaire

Bonaire for example, share the same ISO codes as Sint Eustatius and Saba (which are not listed). The same goes for the three islands of Saint Helena, Ascension and Tristan da Cunha.

Let me know what you think.
Thank you.

Edit: removed South Georgia and the South Sandwich Islands, United States Minor Outlying Islands and Svalbard and Jan Mayen.

Should I encode my russian translated string to Unicode?

Hey there!

I really like your project and I'm ready to add russian translate for every single country name.

Just one question: should I encode that strings to Unicode strings like japanese ones? Russian string looks like this: ”Соединённые Штаты Америки“ (USA).

Thanks.

Please remove “Province of China” from Taiwan

Hi mledoze,

Thanks for this great work, really handy and useful. However it would be even nicer if you can leave Taiwan alone, without the “, Province of China” appendix.

Well it's entirely understandable that this label comes from the ISO 3166 list, but the current truth is Taiwan has its own government and elected president, own currency and own passport. So it would be really thankful if you can just call it “Taiwan” instead. ;)

Thanks anyway,
Zhusee

type inconsistencies in countries.json

Hey. I find that some countries have value for language as an array:
"language": ["English", "Samoan"]

And others have it as string:
"language": "Catalan"

The type should be consistent, and if there's only 1 language, then it should be an array of 1 item.

The problem is that having "language" as string for some and array for others, makes it impossible to deserialize the countries.json :(

Fix the relevance parameter

As @nvitucci noted in #37, the relevance parameter contains inaccurate data.

the strange thing is to have countries like Austria or Chile with a weight of 0 while small countries like Andorra or Isle of Man have a weight of 0.5

We should fix this to make this parameter more relevant.

Bring nationalities into the fold

We're using the entire list to cross-fill in boxes when checking a country, and it seems strange that the list doesn't support nationalities yet. So, as an example:

{
  "name":{
     "common":"Netherlands",
     "official":"Netherlands",
     "native":{
        "common":"Nederland",
        "official":"Nederland"
     }
  },
  "tld":[
     ".nl"
  ],
  "cca2":"NL",
  "ccn3":"528",
  "cca3":"NLD",
  "currency":[
     "EUR"
  ],
  "callingCode":[
     "31"
  ],
  "capital":"Amsterdam",
  "altSpellings":[
     "NL",
     "Holland",
     "Nederland"
  ],
  "relevance":"1.5",
  "region":"Europe",
  "subregion":"Western Europe",
  "nativeLanguage":"nld",
  "languages":{
     "nld":"Dutch"
  },
  "translations":{
     "deu":"Niederlande",
     "fra":"Pays-Bas",
     "hrv":"Nizozemska",
     "ita":"Paesi Bassi",
     "jpn":"\u30aa\u30e9\u30f3\u30c0",
     "nld":"Nederland",
     "rus":"\u041d\u0438\u0434\u0435\u0440\u043b\u0430\u043d\u0434\u044b",
     "spa":"Pa\u00edses Bajos"
  },
  "latlng":[
     52.5,
     5.75
  ],
  "demonym":"Dutch",
  "borders":[
     "BEL",
     "DEU"
  ],
  "area":41850,
  "nationality":"Dutch",
  "nationalities":{
    "nld":"Nederlandse",
    "fra":"Néerlandaise",
    "deu":"Niederländer"
  }
}

Naturally, pay close attention to the last two keys.

Relationship between 'language' and 'languageCodes'

Firstly, thanks for compiling such an awesome dataset!

Secondly, I'm not sure if this is really an issue, or a misunderstanding on my part, but is there supposed to be any correspondence between the contents of language array and the contents of the languageCodes array?

For example, looking at a country like Canada, it seems that there is a relationship:

...
"language": ["English", "French"],
"languageCodes": ["en", "fr"],
...

language here appears to have the names of the languages from languageCodes and in the same order. But then looking at a country like Afghanistan things get less clear:

...
"language": ["Pashto", "Dari"],
"languageCodes": ["ps", "uz", "tk"],
...

Pashto has code 'ps', but the code for Dari is not listed (from a cursory wikipedia search, I think it should be 'fa', but I'm not sure), and then we have no names listed for codes 'uz' and 'tk'. This mismatch also appears to occur for other countries.

I'd be happy to spend some time trying to tidy this up, but:

  1. Is there supposed to be a 1:1 mapping between the two arrays?
  2. If there is, which list is authoritative, or should the contents be synchronized - i.e. for AFG, add a code for Dari and names for uz and tk?

Any thoughts on how to proceed (or not!) would be appreciated!

Svalbard and Jan Mayen issue.

"Svalbard and Jan Mayen (Norwegian: Svalbard og Jan Mayen, ISO 3166-1 alpha-2: SJ, ISO 3166-1 alpha-3: SJM, ISO 3166-1 numeric: 744) is a statistical designation defined by ISO 3166-1 of two parts of Norway under separate jurisdictions—Svalbard and Jan Mayen. While the two are combined for the purposes of the International Organization for Standardization (ISO) category, they are not administratively related." Wikipedia. https://en.wikipedia.org/wiki/Svalbard_and_Jan_Mayen

So they are administratively different, and Svalbard specifically is stated by Svalbard treaty: https://en.wikipedia.org/wiki/Svalbard_and_Jan_Mayen

What data to add next?

I would like to discuss here the data that should be added to this repository.

A similar project like 0xJS [1] contains a lot more data such as the land area or the latitude/longitude coordinates of each country.

Is it interesting/useful to have this kind of data too?

Data that can be added:

  • land (land mass in square kilometers [3])
  • latitude (latitude coordinate of the capital [2])
  • longitude (longitude coordinate of the capital [2])
  • east (longitude of the country's eastern boundary [3])
  • north (latitude of the country's northern boundary [3])
  • south (latitude of the country's southern boundary [3])

What would you like to be added?

Please let me know in the comments.

[1] http://oxjs.org/#doc/Ox.COUNTRIES
[2] source: http://opengeocode.org/
[3] source: https://oxjs.org/#doc/Ox.COUNTRIES


From the comments

native country name

The official name of the country in the country's own language would be useful. I see that it is included in the alternate spelling field but that's a bit arbitrary.

Maybe when the official languages are added, the country name could be a subfield of them (at least in JSON and XML).

Niger demonym

The demonym for Niger is Nigerien. Sources: bit.ly/1BkIjh8 bit.ly/1BkIglH

I´m sorry I dont have time right now to make a PR

nativeName confusion

Hi there,

Let me start by saying thank you for this super useful data in JSON format! I use it for my international telephone input plugin.

But I'm confused about the nativeName field. The readme says "native name in its native language", which seems to be the case a lot of the time e.g. Armenia has "Հայաստան", but then sometimes it seems to be the transliteration(?) e.g. Afghanistan has "Afġānistān" instead of "افغانستان‎".

Cheers,
Jack

Missing Borders

Hello!

I noticed that the following list of countries are missing the borders. Is there a plan to complete this data? I'll try to do some myself.

Åland Islands
American Samoa
Anguilla
Antarctica
Antigua and Barbuda
Aruba
Ascension Island
Australia
The Bahamas
Bahrain
Barbados
Bermuda
Bonaire
Bouvet Island
British Indian Ocean Territory
British Virgin Islands
Cape Verde
Cayman Islands
Christmas Island
Cocos (Keeling) Islands
Comoros
Cook Islands
Cuba
Curaçao
Dominica
Falkland Islands
Faroe Islands
Fiji
French Polynesia
French Southern and Antarctic Lands
Greenland
Grenada
Guadeloupe
Guam
Guernsey
Heard Island and McDonald Islands
Iceland
Isle of Man
Jamaica
Japan
Jersey
Kiribati
Madagascar
Maldives
Malta
Marshall Islands
Martinique
Mauritius
Mayotte
Federated States of Micronesia
Montserrat
Nauru
New Caledonia
New Zealand
Niue
Norfolk Island
Northern Mariana Islands
Palau
Philippines
Pitcairn Islands
Puerto Rico
Réunion
Saint Barthélemy
Saint Helena
Saint Kitts and Nevis
Saint Lucia
Saint Pierre and Miquelon
Saint Vincent and the Grenadines
Samoa
São Tomé and Príncipe
Seychelles
Singapore
Solomon Islands
South Georgia
Svalbard and Jan Mayen
Taiwan
Tokelau
Tonga
Trinidad and Tobago
Turks and Caicos Islands
Tuvalu
United States Minor Outlying Islands
United States Virgin Islands
Vanuatu
Wallis and Futuna

Export tags to packgist

It would be great to be able to check a specific tag out with composer. Ie. export the tags to packagist.org.

This way it is easier to manage dependencies, instead of getting dev master.

Wrong char encoding

These countries aren't displayed correcly:
"R�union" -> Réunion
"Saint Barth�lemy" -> Saint Barthélemy

Ffile & line#:
csv: 181 & 185
json: 180 & 184
xml: 182 & 186

Thanks for this list btw ;)

I need more data, but...

Hi there, I need the country codes, area codes and flags and structure around these. This information appears to be in a mix of here: http://www.wtng.info/wtng-ctn.html and Wikipedia, so I'm going to write an application in Nodejs that grabs the data from http://www.wtng.info/wtng-ctn.html and exports it to a file, allows overrides and merges with your data. I need to do this for work, hence why I want to contribute to this project if thats ok with you.

Zimbabwe native language.

As it got to me #85 , we have an issue to resolve. According to our data native language for Zimbabwe currently is 'sn: Shona'. Officially there 16 official languages:

  • Chewa
  • Chibarwe
  • English
  • Kalanga
  • "Koisan"
  • (presumably Tsoa)
  • Nambya
  • Ndau
  • Ndebele
  • Shangani
  • Shona
  • "sign language"
  • Sotho
  • Tonga
  • Tswana
  • Venda
  • Xhosa

I propose to set English as native for now as a general medium and most neutral language in this list. And because it used in Zimbabwe public media:

Another issue is not all of this languages are defined in Zimbabwe object.

Empty array content

Hi,

Just a quick (possibly silly) question regarding what should be the proper content of a property that would normally be an array, but for a given country has no value. It seems there are currently two different approaches in use for different properties:

  1. An array containing an empty string.
  2. An actual empty array.

An example, taken from the data for Antarctica:

...
"currency": [""],
"callingCode": [""],
...
"borders": [],
...

I assume this should be standardised one way or the other - I'd go for option 2 everywhere - but just wanted to check before I changed anything.

Add country regions, provinces, cities and related infos

From https://github.com/ProGNOMmers
It would be wonderful if it would be possible to retrieve regions, provinces and cities.

Something like:

// Regions of country
// /rest/alpha2/it/regions ->
{ regions:  [ "Abruzzi e Molise",
              "Basilicata",
              "Calabria",
              "Campania",
              "Emilia-Romagna",
              "Friuli-Venezia Giulia",
              "Lazio",
              "Liguria",
              "Lombardia",
              "Marche",
              "Piemonte",
              "Puglia",
              "Sardegna",
              "Sicilia",
              "Toscana",
              "Trentino-Alto Adige",
              "Umbria",
              "Valle d'Aosta",
              "Veneto" ] }

// Provinces of region
// /rest/alpha2/it/regions/Veneto/provinces ->
{ provinces: [ "Verona", "Venezia", ... ] }

// Cities of province
// /rest/alpha2/it/regions/Veneto/provinces/Venezia/cities ->
{ cities: [ { name: "Venezia", zip_codes: [ "30121", ... , "30176" ] }, 
            { name: "Chioggia", zip_codes: [ "30015" ] },
            { name: "San Donà di Piave", zip_codes: [ "30027" ] }, 
            ... ] }

// Cities of country by name
// /rest/alpha2/it/regions/Veneto/provinces/Venezia/cities ->
{ cities: [ { name: "Venezia", zip_codes: [ "30121", ... , "30176" ] }, 
            { name: "Chioggia", zip_codes: [ "30015" ] },
            { name: "San Donà di Piave", zip_codes: [ "30027" ] }, 
            ... ] }

Cities could have metadata like f.i. zip codes, which are very useful.

It is a huge work because recording and maintaining the whole list of regions, provinces and cities for every world country is hard, but it is a good target to be accomplished by an open source project.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.