Download the PHP package prophet777/countries without Composer
On this page you can find all versions of the php package prophet777/countries. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download prophet777/countries
More information about prophet777/countries
Files in prophet777/countries
Package countries
Short Description List of world countries in JSON, CSV, XML and Yaml
License ODbL-1.0
Homepage https://mledoze.github.io/countries/
Informations about the package countries
World countries in JSON, CSV, XML and YAML.
Countries data
This repository contains lists of world countries in JSON, CSV and XML. Each line contains the country:
name
common
- common name in englishofficial
- official name in englishnative
- 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
) - ISO 4217 currency code(s) (
currency
) - calling code(s) (
callingCode
) - 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
) - name of residents (
demonym
) - landlocked status (
landlocked
) - land borders (
borders
) - land area in km² (
area
) - Emoji flag (
flag
)
Additional data
The data folder contains additional data such as the countries GeoJSON outlines and flags in SVG format.
Examples
JSON
GeoJSON and TopoJSON outlines
See an example for Germany: GeoJSON or TopoJSON.
CSV
XML
YAML
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:
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):
You can also exclude multiple fields:
If you prefer to include only some fields (this can not be combined with --exclude-field
):
The generated files are put into the dist
directory, but you can change this to another existing directory:
You can also choose to only generate some of the output formats:
Showcase
Projects using this dataset:
- REST Countries
- International Telephone Input
- Telephone JS
- Countries of the World
- Country Prefix Codes For Go
- Country Info Mapper in Go
- Visa requirements in JSON
- Country picker modal for React Native
- Agnostic Virtual Assistant
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:
- @Glazz for his help with country calling codes
- @hexorx for his work (https://github.com/hexorx/countries)
- @frederik-jacques for the capital cities
- @fayer for the population, geolocation, demonym and area data
- @ancosen for his help with the borders data
- @herrjemand for country names and various fixes
- all the contributors: https://github.com/mledoze/countries/graphs/contributors
License
See LICENSE.
All versions of countries with dependencies
symfony/console Version ^2.8|^3.4|~4.0
symfony/yaml Version ^2.8|^3.4|~4.0