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

Overview

World countries in JSON, CSV, XML and YAML.

Latest Stable Version Latest Stable Version License PHP from Packagist

Build Status Scrutinizer Code Quality 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="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.)
  • add missing translations
  • 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.

Comments
  • Relationship between 'language' and 'languageCodes'

    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!

    opened by petert82 41
  • Updated calling codes as proposed at #114

    Updated calling codes as proposed at #114

    Changed the callingCode property to callingCodes. Updated calling codes as proposed @nasht00 at #114. Added Sardinian language as recognized minority language of Italy. Proposed by @chrispecoraro.

    opened by herrjemand 36
  • Add the country states/regions

    Add the country states/regions

    The idea is to add the country states or regions (depending on the country).

    A format was proposed here: https://github.com/mledoze/countries/issues/6#issuecomment-27620009

    @shanti2530 suggets to import the data from: http://vikku.info/programming/geodata/geonames-get-country-state-city-hierarchy.htm

    I propose not to add cities because it would make the dataset too big in my opinion. I prefer to focus on top-level data.

    opened by mledoze 26
  • Duplicated ccn3 code for Trinidad and Tobago & Kosovo

    Duplicated ccn3 code for Trinidad and Tobago & Kosovo

    On ISO 3166-1 "780" code is assigned to Trinidad and Tobago

    But on countries.json Kosovo had the same number assigned, something that IMHO isn't correct because is Trinidad and Tobago's code.

    I look for the correct code but I had no luck so far, I can't find it

    opened by cumanacr 19
  • Looks like England/Scotland/Northern Ireland/Wales are missing

    Looks like England/Scotland/Northern Ireland/Wales are missing

    Is there a reason for these countries to be missing? It looks important to me to have them, I feel like everyone knows them well (except maybe for Wales) and would therefore expect them to "exist" and be part of any application that displays countries.

    If you ask to a random person "in which country is Belfast located?" I'm pretty sure that a vast majority would answer Northern Ireland (or Ireland) before UK.

    What is even stranger is the presence of states like "Monaco" for which the term country looks a bit overrated (maybe because I'm French).

    opened by cglacet 17
  • Please remove “Province of China” from Taiwan

    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

    feature request 
    opened by zhusee2 17
  • TimeZone information added, as well as PHP parser/updater.

    TimeZone information added, as well as PHP parser/updater.

    The data is downloaded from latest public tzdata database. Update script: parse data and save changes to countries.json Shows result running via cli: Parsed 416 tz records; +added:416 -removed:0

    opened by semsono 16
  • Proposal: remove some entries

    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.

    opened by mledoze 15
  • Zimbabwe native language.

    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:

    • http://www.zim.gov.zw/
    • http://www.zispa.org.zw/
    • http://www.newzimbabwe.com/
    • http://www.dailynews.co.zw/
    • https://www.newsday.co.zw/
    • etc

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

    opened by herrjemand 15
  • Bring nationalities into the fold

    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.

    opened by ReSpawN 12
  • Add translated demonyms in French.

    Add translated demonyms in French.

    Hi,

    First of all, thank you for this project 💯

    As suggested in #165, I added translated demonyms (in French). It is indexed by f or m to manage gender inflection. I decided to add a new key rather than changing the structure, to keep things backward compatible. Tell me if it's ok for you.

    I used a PHP script to decode/encode the countries.json file, so some indentation may have changed (I used json_encode with JSON_PRETTY_PRINT option). You can add ?w=1 to the GitHub URL to get rid of whitespace changes.

    opened by alexsegura 11
  • inconsistent specification of the absence of calling codes

    inconsistent specification of the absence of calling codes

    the unescaped json generated file https://raw.githubusercontent.com/mledoze/countries/master/dist/countries-unescaped.json contains the "no calling codes" specification in several different manners, e.g.

    Heard Island and McDonald Islands: "callingCodes": [ "" ]

    Antarctica: "callingCodes": []

    i think it would be better to use a unified convention, e.g. the empty array only.

    opened by minisaw 1
  • Languages of Afghanistan

    Languages of Afghanistan

    Turkmen is included in the list, but it does not seem to be official on the national level. Quoting from Wikipedia:

    The official languages of the country are Dari and Pashto, as established by the 1964 Constitution of Afghanistan. Dari is the most widely spoken language of Afghanistan's official languages and acts as a lingua franca for the country. In 1980, other regional languages were granted official status in the regions where they are the language of the majority.[19] This policy was codified in the 2004 Afghan Constitution, which established Uzbek, Turkmen, Balochi, Pashayi, Nuristani and Pamiri as a third official language in areas where they are spoken by a majority of the population.

    Given that it's spoken by a mere 2% of the population and the fact that it does not really stand out among the "regionally official" languages, I think Turkmen should be removed from the list of official languages.

    opened by kerams 0
  • Update Guinea-Bissau UN membership to true

    Update Guinea-Bissau UN membership to true

    Hi I noticed that Guinea-Bissau has unMember: false, but it is actually a member. (Data source here: https://www.un.org/en/about-us/member-states#gotoG). Here's a pull request to rectify that.

    Thanks, Ed

    opened by edwardball 0
Releases(v4.1.0)
  • v4.1.0(Feb 25, 2022)

    Added

    • add Swedish translation (#398)
    • add a changelog (#383)
    • add Hungarian translation (#385)
    • add UN membership boolean flag to each country (#401)
    • add geojson and topojson for South Sudan (#406)
    • add geojson and topojson for Sint Maarten (SX) (#407)
    • add geojson and topojson for the Caribbean Netherlands (BQ) (#407)

    Changed

    • sort translations alphabetically (#384)
    • remove South Sudan from Sudan's geojson and topojson (#406)
    • change subregion to Eastern Europe for Slovakia (#413)
    • change first letter of Czechia to uppercase (#431)
    • add capital for Bonaire, Sint Eustatius and Saba (#441)
    • add TLD for Kosovo (#441)

    Fixed

    • fixed missing idd suffixes of Canada and USA (#426)
    • rename capital city of Kazakhstan from Astana to Nur-Sultan (#391)
    • change capital city of Burundi from Bujumbura to Gitega (#391)
    • change demonym of United States Minor Outlying Islands to American Islander (#391)
    • add South African rand as a currency to Eswatini (#391)
    • remove St Barthelemy from Guadaloupe geojson and topojson (#407)
    • set St Barthelemy's geojson and topojson to correct region (#407)
    • remove duplicate viewBox for Cuba's flag (#411)
    • fixed idd of Russia and Kazakhstan by removing XX suffix (#425)
    • remove new line character in Congo's translations (#430)
    • fix Montenegrin language code (#434)
    • fix IOC code for Lebanon and Singapore (#441)

    Build

    • add files in package.json to reduce package size (#388)
    • generate calling codes (callingCodes) from international direct dialing info (idd) (#389)
    • drop support for old versions of PHP and Symfony packages (#435)
    Source code(tar.gz)
    Source code(zip)
  • v4.0.0(Apr 4, 2020)

    Breaking changes

    • merge demonym into demonyms (https://github.com/mledoze/countries/pull/369)
    • remove property demonym (https://github.com/mledoze/countries/pull/369)

    Before

    "demonym": "Irish",
    ...
    "demonyms": {
        "fra": {
            "f": "Irlandaise",
            "m": "Irlandais"
        }
    }
    

    After

    "demonyms": {
        "eng": {
            "f": "Irish",
            "m": "Irish"
        },
        "fra": {
            "f": "Irlandaise",
            "m": "Irlandais"
        }
    }
    

    Additions

    • add translated demonyms in French (https://github.com/mledoze/countries/pull/343)
    • add DPRK as an alternative spelling to North Korea (https://github.com/mledoze/countries/pull/371)
    • add altSpelling to Macedonia (#377)

    Changes

    • update TypeScript types to v3 (#376)

    Fixes

    • fix Curaçao calling code (https://github.com/mledoze/countries/pull/370)
    • fix wrong Iran language code, update the language label (https://github.com/mledoze/countries/pull/374)
    • fix Spanish spelling for Haiti (#380)
    Source code(tar.gz)
    Source code(zip)
  • v3.0.0(Dec 18, 2019)

    Breaking changes

    • rename property currency to currencies
    • change format of currencies property: it is now an object with currency code as keys. The value is an object with name and symbol properties.

    Before

    "currency": ["SHP", "GBP"]
    

    After

    "currencies": {
        "GBP": {
            "name": "Pound sterling",
            "symbol": "\u00a3"
        },
        "SHP": {
            "name": "Saint Helena pound",
            "symbol": "\u00a3"
        }
    }
    

    Additions

    • add International Direct Dialing codes (idd property); example:
    "idd": {
        "root": "+2",
        "suffixes": [
            "90",
            "47"
        ]
    }
    
    • add Persian translations
    • add Korean translations
    • add Urdu translations
    • add missing currency codes
    • add missing Korean common translation for Wallis and Futuna
    • add types for TypeScript
    • add Symfony 5 support

    Changes

    • change name of Macedonia to North Macedonia
    • update translations of North Macedonia
    • update flag of Bolivia and Peru
    • reorder currencies codes alphabetically
    • change demonym of Myanmar to Burmese
    • update entry for Curaçao

    Fixes

    • rename 'Dollar' to 'dollar'
    • replace sovereing with sovereign
    • fix names of Saint Kitts and Nevis
    • remove [G] in currency codes
    • fix official German name for Nepal
    • fix Kazakhstan calling code
    • replaces (none) with empty strings

    Build

    • migrate CI from Travis to GitHub Actions

    Miscellaneous

    • add the full ODbL license
    • update build status badge with
    Source code(tar.gz)
    Source code(zip)
  • v2.1.0(Nov 9, 2018)

    Additions

    added Czech translations added Polish translations added missing Croatian translation for Sint Maarten

    Fixes

    replaced "Northern America" by "North America" removed fund codes from currencies renamed Swaziland to Eswatini revised some German translations fixed Vatican City demonym fixed Macau demonym fixed some Unicode typos fixed type of 'name.native' when property is empty fixed official and common country name of Korea fixed official and native name of the Netherlands (#277)

    Build

    fixed output message when converting with specific format(s) (#281) formatted code to comply with PSR2 coding standard removed Hungarian notation in PHP Code moved dependency roave/security-advisories to require-dev section

    Miscellaneous

    added badge for PHP minimum version added scrutinizer badge

    Source code(tar.gz)
    Source code(zip)
  • v2.0.0(Feb 8, 2018)

    Announcement

    This project now requires the latest version of PHP 5, which is 5.6.33. This will be the last release to support PHP 5. The next major release (v3.0.0) will require PHP 7.2.

    Breaking changes

    changed type of property capitals from string to array to support countries with multiple capitals changed semicolon to comma for CSV format (see https://github.com/mledoze/countries/blob/e2de3c46402c2b7a90d30fa1d6d1151e97420992/dist/countries.csv) moved SHN and BES divisions back into the main countries.json as two separate entries; also removed files data/shn.divisions.json and data/bes.divisions.json removed region specific languages (see #181) removed South Sudan from Chad's neighbours

    Additions

    added ISO 3166-1 independence status (property independent) added ISO 3166-1 assignment status (property status) added TopoJSON formatted files for each country added Estonian translations added Guiana demonym for French French Guiana

    Build

    added three new options: --include-field, --format and --output-dir (thank you @emilv) added Travis CI to automatically validate new pull requests updated dependencies:

    • php (>=5.5.9 => >=5.6.33)
    • symfony/console (v3.1.3 => v4.0.4)
    • symfony/yaml (v3.1.3 => v4.0.4)

    Fixes

    added "The Netherlands" as alternate spelling of Netherlands added CKD as currency of Cook Islands added "Antarctic" region for multiple countries added latitude and longitude data for United States Minor Outlying Islands updated alternative spellings of Cocos (Keeling) Islands updated official languages of Armenia removed province of China and use Traditional Chinese instead of Simplified Chinese fixed capital of Ukraine fixed non-existing slk language fixed land borders for China, Cyprus, Chad, Egypt, India, Jordan and Israel fixed Russian translation of Mexico fixed existing official names in Welsh fixed Russia native official name according to en.wikipedia.org/wiki/Russia fixed Czech Republic short names fixed Slovakian translation ISO code fixed subregion field for Mexico fixed altSpellings field for Belarus fixed country name and currency code for Belarus

    Miscalleanous

    changed licence label to "ODC Open Database License v1.0" to comply with SPDX names

    Source code(tar.gz)
    Source code(zip)
  • v1.8.0(Sep 1, 2016)

    Additions

    add Slovak translations add Chinese translations add Dutch translation for Kosovo add German translations for Kosovo and Curaçao

    Build

    add composer.lock file to prevent dependencies issues allow setting a custom command name

    Fixes

    fix native name for Nepal (from https://github.com/fayder/restcountries/pull/23) change demonym for Argentina to Argentine fix demonym for Christmas Island fix subregion in Slovak Republic replace all "cmn" with "zho" replaced Kosovo's International Olympic Committee code by ISO 3166-1 alpha-3 code in land borders array

    Source code(tar.gz)
    Source code(zip)
  • v1.7.7(Jan 28, 2016)

  • v1.7.6(Jan 21, 2016)

  • v1.7.5(Jan 20, 2016)

  • v1.7.4(Jun 20, 2015)

  • v1.7.3(Apr 5, 2015)

    Breaking changes

    removed Bonaire and Saint Helena, Ascension and Tristan da Cunha from countries.json and moved them respectively in data/bes.divisions.json and data/shn.divisions.json (see #93)

    Addition

    added new property: International Olympic Committee country code (cioc) added Ascension and Tristan da Cunha to data/shn.divisions.json added Sint Eustatius and Saba to data/bes.divisions.json added Tamil to the list of Indian languages added missing ISO 3166-1 names to altSpellings added sardinian language to Italy added sardinian translation of the Italian name added finish translations added basque language name to Spain

    Build

    update composer dependencies

    Fixes

    made Kuwait border Iraq removed Iran from Kuwait borders

    Thank you to all the contributors who helped for this release!

    Source code(tar.gz)
    Source code(zip)
  • v1.7.2(Mar 7, 2015)

  • v1.7.1(Mar 7, 2015)

    Breaking changes

    removed relevance data, see #41

    Addition

    added bower.json to make this project available as a Bower package added note about editing languages in CONTRIBUTING.md

    Build

    renamed CountryData to Converter renamed Converter interface to ConverterInterface

    Fixes

    fixed data for South Soudan, Bonaire and Curazao fixed spelling in german translation for Egypt removed cca3 code from Kosovo

    Source code(tar.gz)
    Source code(zip)
  • v1.7.0(Feb 6, 2015)

    Breaking changes

    New format for country names.

    The country names (property name.native) now contains every native languages. Thus the nativeLanguage property, which used to identify the language code used for the native country names, has been removed.

    Before

    {
        "name": {
            "common": "Peru",
            "official": "Republic of Peru",
            "native": {
                "common": "Per\u00fa",
                "official": "Rep\u00fablica del Per\u00fa"
            }
        },
        "...": "...",
        "nativeLanguage": "spa",
        "languages": {
            "aym": "Aymara",
            "que": "Quechua",
            "spa": "Spanish"
        }
    }
    

    After

    {
        "name": {
            "common": "Peru",
            "official": "Republic of Peru",
            "native": {
                "aym": {
                    "official": "Piruw Suyu",
                    "common": "Piruw"
                },
                "que": {
                    "official": "Piruw Ripuwlika",
                    "common": "Piruw"
                },
                "spa": {
                    "official": "Rep\u00fablica del Per\u00fa",
                    "common": "Per\u00fa"
                }
            }
        },
        "...": "...",
        "languages": {
            "aym": "Aymara",
            "que": "Quechua",
            "spa": "Spanish"
        }
    }
    
    New format for translations

    As proposed by @herrniemand, the format for translations has been updated to include official country names. Hereafter an example for Peru:

    Before

    {
          "translations": {
            "deu": "Peru",
            "fra": "P\u00e9rou",
            "hrv": "Peru",
            "ita": "Per\u00f9",
            "jpn": "\u30da\u30eb\u30fc",
            "nld": "Peru",
            "por": "Per\u00fa",
            "rus": "\u041f\u0435\u0440\u0443",
            "spa": "Per\u00fa"
        }
    }
    

    After

    {
        "translations": {
            "deu": {"official": "Republik Peru", "common": "Peru"},
            "fra": {"official": "R\u00e9publique du P\u00e9rou", "common": "P\u00e9rou"},
            "hrv": {"official": "Republika Peru", "common": "Peru"},
            "ita": {"official": "Repubblica del Per\u00f9", "common": "Per\u00f9"},
            "jpn": {"official": "\u30da\u30eb\u30fc\u5171\u548c\u56fd", "common": "\u30da\u30eb\u30fc"},
            "nld": {"official": "Republiek Peru", "common": "Peru"},
            "por": {"official": "Rep\u00fablica do Peru", "common": "Per\u00fa"},
            "rus": {"official": "\u0420\u0435\u0441\u043f\u0443\u0431\u043b\u0438\u043a\u0430 \u041f\u0435\u0440\u0443", "common": "\u041f\u0435\u0440\u0443"},
            "spa": {"official": "Rep\u00fablica de Per\u00fa", "common": "Per\u00fa"}
        }
    }
    

    Addition

    add alternative name and spellings for East Timor

    Build

    A new build system has been introduced by @petert82. The single script is split up into individual files in src/ and the symfony Console component as a dependency, to make it nice and easy to extend the conversion options in future.

    To build the dist files, the command is now php countries.php convert.

    Updates

    change Lithuania currency to EUR change zambian currency to ZMW

    Fixes

    fix Kosovo calling code fix demonym of Myanmar fix official Swahili name of Kenya

    Again, a huge thank you goes to @herrniemand and @petert82 for their ideas and help on this.

    Source code(tar.gz)
    Source code(zip)
  • v1.6.2(Jan 21, 2015)

    Addition

    add landlocked data (as proposed by @romsson) add commands in CONTRIBUTING.md to generate dist files

    Fixes

    fix Saint-Martin and Saint-Pierre-and-Miquelon mixed up names fix flags ratio fixed Western Sahara names

    Source code(tar.gz)
    Source code(zip)
  • v1.6.1(Jan 12, 2015)

    Addition

    this project is now available on Packagist: https://packagist.org/packages/mledoze/countries add demonym for Antarctica add Countries of the World in showcase list add portuguese country name translations add missing area data added russian language to Azerbaijan

    Build

    add a yaml converter add processEmptyArrays method for JSON converters refactor loop for fields to keep change PHP_EOL to \n

    Fixes

    fix DR Congo common name fix afghanistan portuguese translation fix denonym for Mayotte and South Georgia fix names for Kosovo bump version fix Georgia's area remove Armenian language to Azerbaijan

    Source code(tar.gz)
    Source code(zip)
  • v1.6(Sep 12, 2014)

    Breaking changes

    New format for country names.

    The name property is now an object containing the common and official names of the country both in english and in the official native language of the country (the language used for this is identified by the new nativeLanguage property; see below).

    Before

    {
          "name": "Switzerland",
          "nativeName": "Schweiz",
          "..."
    }
    

    After

    {
        "name": {
            "common": "Switzerland",
            "official": "Swiss Confederation",
            "native": {
                "common": "Schweiz",
                "official": "Schweizerische Eidgenossenschaft"
            }
        },
        "..."
    }
    
    New format for country languages.

    The language property is now an object where keys are ISO 639-3 codes (alpha 3) and values are the name of the language in english.

    The nativeLanguage property contains the ISO 639-3 code of the language used for the native country names.

    Before

    {   
        "...",
        "language": ["Finnish", "Swedish"],
        "languageCodes": ["fi", "sv"]
        "..."
    }
    

    After

    {
        "...",
        "nativeLanguage": "fin",
        "languages": {
            "fin": "Finnish",
            "swe": "Swedish"
        },
        "..."
    }
    

    The keys in the translations property are ISO 639-3 languages codes as well.

    Credits to @herrniemand and @petert82 for the original idea and help on this.

    Addition

    add official names in english and in the country native language add TLD's for Tailand, Taiwan, Syria, Sri Lanka, South Korea, Singapore, Algeria, Jordan, Morocco, Palestine and Qatar

    Build

    update the convertArrays function to handle multi dimensionnal arrays

    Fixes

    fix data for Saint Kitts and Nevis fix demonym for Niger fix broken link in README update examples fix Thailand borders fix Senegal borders

    Source code(tar.gz)
    Source code(zip)
  • v1.5.1(Jul 31, 2014)

  • v1.5(Jul 30, 2014)

    Breaking changes

    remove Ascension Island (merged with Saint Helena, see #57)

    Addition

    add countries GeoJSON outline (example https://github.com/mledoze/countries/blob/4251a5f95d5255a913a397d831dd75080e370f33/data/deu.geo.json) add russian translations for all countries (thanks @eugene-lazarev) add unescaped JSON version add "How to contribute" section in README

    This project is now available as a NPM package: https://www.npmjs.org/package/world-countries

    Fixes

    fix Libya CCA3 in Algeria's borders fix russian translations, replace \x20 and \x2d with a space and a hyphen fix calling code for Vatican City fix data for Hong Kong fix language and language codes for Norway (fix #56) remove BRA-FRA, SUR-FRA, MAF-NED borders for Brazil, Suriname and France

    Source code(tar.gz)
    Source code(zip)
  • v1.4(May 7, 2014)

    Breaking changes

    remove population data (see https://github.com/mledoze/countries/issues/6#issuecomment-42322804) rename Côte d'Ivoire to Ivory Coast

    Addition

    add area data in km² add countries flag in SVG format (see data folder, source: https://github.com/tinata/tinatapi) add welsh translations add Ascension Island add showcase section in README add CONTRIBUTING

    Fixes

    fix missing borders, latitude/longitude and language codes fix encoding of accented characters in translations fix native names for countries with right-to-left language fix/reorder language codes for some countries fix spanish translation of Chad fix language for Egypt fix denonym for United Arab Emirates fix region and subregion for Cyprus

    Source code(tar.gz)
    Source code(zip)
  • v1.3(Feb 22, 2014)

    Breaking changes

    remove english translations since they are redundant with the name parameter rename languagesCodes to languageCodes

    Build

    move generated files to the dist folder prettify JSON source to ease the contributions add script to generate other formats (the source is the JSON file)

    Additions

    add geolocation, population, borders and demonym data add language codes and translations for multiple countries add Republic of Kosovo (#27) add missing population field for some countries (-1 is used if there is no data)

    Fixes

    fix many type inconsistencies fix/add translations, mainly french fix NL translation of Macedonia fix currency for Colombia and Mexico fix denonym for Åland Islands fix null values for latitude/longitude rename Macao to Macau convert multiple values to real JSON arrays

    Source code(tar.gz)
    Source code(zip)
  • v1.2(Nov 18, 2013)

    added license (Open Database License) added country native name in its native language added country official language(s) in english added alt spellings: official country name in english and in its official language(s) added region and subregion for Bonaire, Sint Maarten and South Sudan added capital for British Indian Ocean Territory, Micronesia, Réunion, South Georgia, Virgin Islands (British) and Virgin Islands (U.S.) added currency for Palestinian Territory added examples in README

    change TLD for the UK from .gb to .uk using camelCase in countries.json

    fixed alt spellings for Czech Republic fixed typo in Canada's and Russia's capital fixed currency and alt-spelling for Slovakia fixed currency code for Solomon Islands, Somalia and South Africa fixed South Georgia currency fixed relevance for Åland Islands and Finland fixed ccn3 padding fixed subregion for Brunei Darussalam, Cambodia, Indonesia, Laos, Malaysia, Myanmar, Philippines, Singapore, Thailand, Timor-Leste and Vietnam fixed TLD for Bonaire, Heard and McDonald Islands, Kazakhstan and Saint Martin fixed capital for Moldova fixed alt-spellings for United Kingdom

    rename Brunei Darussalam to Brunei rename Falkland Islands (Malvinas) to Falkland Islands rename French Southern Territories to French Southern and Antarctic Lands rename Myanmar (Burma) to Myanmar (added Burma in alt-spellings) rename Palestinian Territory to Palestine rename Pitcairn to Pitcairn Islands rename Russian Federation to Russia rename Syrian Arab Republic to Syria rename Virgin Islands (British) to British Virgin Islands rename Virgin Islands (U.S.) to United States Virgin Islands

    Source code(tar.gz)
    Source code(zip)
  • v1.1(Oct 4, 2013)

  • v1.0(Jul 26, 2013)

Owner
Mohammed Le Doze
Mohammed Le Doze
Map nested JSON structures onto PHP classes

JsonMapper - map nested JSON structures onto PHP classes Takes data retrieved from a JSON web service and converts them into nested object and arrays

Christian Weiske 1.4k Nov 22, 2022
JsonMapper - map nested JSON structures onto PHP classes

Takes data retrieved from a JSON web service and converts them into nested object and arrays - using your own model classes.

Netresearch 9 Aug 21, 2022
:lipstick: Scalable and durable all-purpose data import library for publishing APIs and SDKs.

Porter Scalable and durable data imports for publishing and consuming APIs Porter is the all-purpose PHP data importer. She fetches data from anywhere

null 556 Oct 15, 2022
CRUDlex is an easy to use CRUD generator for Symfony 4 and Silex 2 which is great for auto generated admin pages

CRUDlex CRUDlex is an easy to use, well documented and tested CRUD generator for Symfony 4 and Silex 2. It is very useful to generate admin pages for

Philip 108 Jun 30, 2022
A repository with implementations of different data structures and algorithms using PHP

PHP Data Structures and Algorithms Data structure and Algorithm is always important for any programming language. PHP, being one of the most popular l

Mizanur Rahman 609 Nov 18, 2022
Leetcode for PHP, five questions a week and weekends are updated irregularly

✏️ Leetcode for PHP why do you have to sleep for a long time ,and naturally sleep after death 联系 说明 由于目前工作主要是 golang,我又新起了一个LeetCode-Go-Week项目,- Leetc

吴亲库里 370 Nov 15, 2022
True asynchronous PHP I/O and HTTP without frameworks, extensions, or annoying code. Uses the accepted Fibers RFC to be implemented into PHP 8.1

PHP Fibers - Async Examples Without External Dependencies True asynchronous PHP I/O and HTTP without frameworks, extensions, or annoying code behemoth

Cole Green 119 Nov 30, 2022
Best FlexForm based content elements since 2012. With TCA mapping feature, simple backend view and much more features which makes it super easy to create own content element types.

DCE-Extension for TYPO3 What is DCE? DCE is an extension for TYPO3 CMS, which creates easily and fast dynamic content elements. Based on Extbase, Flui

Armin Vieweg 10 Nov 2, 2022
World countries - available in multiple languages, in CSV, JSON, PHP, SQL and XML formats

Constantly updated lists of world countries and their associated alpha-2, alpha-3 and numeric country codes as defined by the ISO 3166 standard, available in CSV, JSON , PHP, SQL and XML formats, in multiple languages and with national flags included; also available are the ISO 3166-2 codes of provinces/ states associated with the countries

Stefan Gabos 995 Nov 27, 2022
Provide CSV, JSON, XML and YAML files as an Import Source for the Icinga Director and optionally ship hand-crafted additional Icinga2 config files

Icinga Web 2 Fileshipper module The main purpose of this module is to extend Icinga Director using some of it's exported hooks. Based on them it offer

Icinga 25 Sep 18, 2022
YCOM Impersonate. Login as selected YCOM user 🧙‍♂️in frontend.

YCOM Impersonate Login as selected YCOM user in frontend. Features: Backend users with admin rights or YCOM[] rights, can be automatically logged in v

Friends Of REDAXO 17 Sep 12, 2022
Laravel Countries is a bundle for Laravel, providing Almost ISO 3166_2, 3166_3, currency, Capital and more for all countries.

Laravel Countries Laravel Countries is a bundle for Laravel, providing Almost ISO 3166_2, 3166_3, currency, Capital and more for all countries. Please

Christoph Kempen 692 Nov 27, 2022
The Yaml component loads and dumps YAML files.

Yaml Component The Yaml component loads and dumps YAML files. Resources Documentation Contributing Report issues and send Pull Requests in the main Sy

Symfony 3.5k Nov 25, 2022
Simplexcel.php - Easily read / parse / convert / write between Microsoft Excel XML / CSV / TSV / HTML / JSON / etc spreadsheet tabular file formats

Simple Excel Easily parse / convert / write between Microsoft Excel XML / CSV / TSV / HTML / JSON / etc formats For further deatails see the GitHuib P

Faisal Salman 547 Nov 24, 2022
Improve default Magento 2 Import / Export features - cron jobs, CSV , XML , JSON , Excel

Improve default Magento 2 Import / Export features - cron jobs, CSV , XML , JSON , Excel , mapping of any format, Google Sheet, data and price modification, improved speed and a lot more!

Firebear Studio 173 Aug 18, 2022
JSONFinder - a library that can find json values in a mixed text or html documents, can filter and search the json tree, and converts php objects to json without 'ext-json' extension.

JSONFinder - a library that can find json values in a mixed text or html documents, can filter and search the json tree, and converts php objects to json without 'ext-json' extension.

Eboubaker Eboubaker 2 Jul 31, 2022
A plugin to make life easier for users who need to edit specific functions of a world and also create, rename and delete worlds quickly using commands or the world management menu.

A plugin to make life easier for users who need to edit specific functions of a world and also create, rename and delete worlds quickly using commands or the world management menu.

ImperaZim 0 Nov 6, 2022
ChestRandomBP: This plugin generates chests in random places within a specific world. Where you can customize what each one of them contains, the time and the world of spawning.

ChestRandomBP ChestRandomBP: This plugin generates chests, it works PocketMine-MP and random places within a specific world. Where you can customize w

null 5 Sep 19, 2021
Magento commands to find translations that are present in one CSV file but not in another, and to translate CSV dicts with DeepL

Hyvä Themes - Magento translation CSV comparison command hyva-themes/magento2-i18n-csv-diff This module adds the bin/magento i18n:diff-csv and i18n:tr

Hyvä 6 Oct 26, 2022
A horrendous PM plugin to manually load all the chunks in your world without logging on. Only for the sole purpose of aiding in PM4 -> DF world conversion.

ChunkLoader A horrendous PM plugin to manually load all the chunks in your world without logging on. Only for the sole purpose of aiding in PM4 -> DF

null 2 Aug 10, 2022