{"id":13773093,"url":"https://github.com/OpenBookPrices/country-data","last_synced_at":"2025-05-11T05:34:18.474Z","repository":{"id":7876819,"uuid":"9250666","full_name":"OpenBookPrices/country-data","owner":"OpenBookPrices","description":"Country related data such as ISO codes, currencies etc","archived":false,"fork":false,"pushed_at":"2022-08-15T19:28:08.000Z","size":387,"stargazers_count":514,"open_issues_count":36,"forks_count":165,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-11-01T04:03:43.512Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OpenBookPrices.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-04-05T21:08:15.000Z","updated_at":"2024-10-22T10:00:35.000Z","dependencies_parsed_at":"2022-09-03T09:41:33.749Z","dependency_job_id":null,"html_url":"https://github.com/OpenBookPrices/country-data","commit_stats":null,"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenBookPrices%2Fcountry-data","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenBookPrices%2Fcountry-data/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenBookPrices%2Fcountry-data/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenBookPrices%2Fcountry-data/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenBookPrices","download_url":"https://codeload.github.com/OpenBookPrices/country-data/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225017656,"owners_count":17407811,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T17:01:11.269Z","updated_at":"2024-11-17T08:30:42.181Z","avatar_url":"https://github.com/OpenBookPrices.png","language":"JavaScript","funding_links":[],"categories":["World Data (Countries, Cities, etc.)"],"sub_categories":["More"],"readme":"# Country Data\n\n[![Build Status](https://travis-ci.org/OpenBookPrices/country-data.png)](https://travis-ci.org/OpenBookPrices/country-data)\n\nThere are lots of little bits of data that you often need relating to countries,\nand I couldn't find any easy to use source of it. So I compiled it all here.\n\n## Work in Progress\n\nThis code base may change a bit until it hits `0.1.x` - feel free to use it, but be sure to check between upgrades.\n\nI suspect that many of the `currencies` entries on the countries may be wrong. Help checking them would be appreciated.\n\n\n## Countries\n\nThe data currently provided for each country is:\n\n  * `name` The english name for the country\n  * `alpha2` The [ISO 3166-1 alpha 2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code\n  * `alpha3` The [ISO 3166-1 alpha 3](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) code\n  * `status`: The ISO status of the entry - see below.\n  * `currencies` An array of [ISO 4217 currency codes](http://en.wikipedia.org/wiki/ISO_4217) with the primary one first\n  * `languages` An array of [ISO 639-2](http://en.wikipedia.org/wiki/ISO_639-2) codes for languages (may not be complete).\n  * `countryCallingCodes` An array of the international call prefixes for this country.\n  * `ioc` The [International Olympic Committee country code](http://en.wikipedia.org/wiki/List_of_IOC_country_codes)\n  * `emoji` The emoji of country's flag.\n\n### Status notes\n\nThe `status` can be one of 'assigned', 'reserved', 'user assigned' or 'deleted'.\n\nAssigned means that the code is properly in the ISO 3166 standard. Reserved means that the code is being prevented from being used. Deleted means that it has been deleted. User Assigned means that for some use cases it is required. Deleted means that it used to be in the standard but is now not.\n\nSee https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 for full details, especially the \"User-assigned code elements\" and \"Reserved code elements\" sections.\n\n## Regions\n\nCountries are ofter grouped into regions. The list of regions is by no means exhaustive, pull requests very welcome for additions.\n\n  * `countries` An array of `alpha2` codes for the countries in this region.\n\n## Currencies\n\nIt is not that useful to just have the currency code(s) for a country, so included is currency data too:\n\n  * `name` The english name for the currency\n  * `code` The [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) code\n  * `number` The [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) number\n  * `decimals` The number of decimal digits conventionally shown\n  * `symbol` The currency symbol for the currency (e.g. ¥, $ etc.). Some symbols are not available, in which case\n    `symbol` contains the ISO 4217 code.  Credit to [bengourley/currency-symbol-map](https://github.com/bengourley/currency-symbol-map)\n    for the symbol database.\n\n## Languages\n\nA list of languages provided by [ISO 639-2](http://en.wikipedia.org/wiki/ISO_639-2);\n\n  * `name` The english name for the language\n  * `alpha2` The two letter [ISO 639-1](http://en.wikipedia.org/wiki/ISO_639-1) code for the language (may be blank).\n  * `alpha3` The three letter terminological [ISO 639-2](http://en.wikipedia.org/wiki/ISO_639-2) code for the language (may be blank).\n  * `bibliograpic` The three letter bibliographic [ISO 639-2](http://en.wikipedia.org/wiki/ISO_639-2) code for the language (may be blank).\n\n## Lookup\n\nTo make finding easier there are utility methods that can search the countries and currencies. See examples below.\n\n\n## Installing\n\n``` bash\nnpm install country-data\n```\n\n\n## Example usage\n\n``` javascript\nvar countries        = require('country-data').countries,\n    currencies       = require('country-data').currencies,\n    regions          = require('country-data').regions,\n    languages        = require('country-data').languages,\n    callingCountries = require('country-data').callingCountries;\n\n// .all gives you an array of all entries\nconsole.log( countries.all );\nconsole.log( currencies.all );\n\n// countries are found using alpha2 or alpha3 (both uppercase)\nconsole.log( countries.BE.name );        // 'Belgium'\nconsole.log( countries.FRA.currencies ); // ['EUR']\n\n// callingCountries is like countries but only has entries with dialing codes.\n\n// currencies are accessed by their code (uppercase)\nconsole.log( currencies.USD.name ); // 'United States dollar'\n\n// regions are accessed using a camel case name\nconsole.log( regions.europe.countries )\n```\n\n``` javascript\nvar lookup = require('country-data').lookup;\n\n// Match a value (grab first from array)\nvar france = lookup.countries({name: 'France'})[0];\n\n// Or match one of several possible values.\nvar eurozone_countries = lookup.countries({currencies: 'EUR'});\n```\n\nIt is very simple for now - feel free to contribute more helpful accessors.\n\n\n## Possible future additions\n\nMore data for each country is most welcome. Obvious things that it might be nice\nto add are:\n\n### Countries\n\n  * Wikipedia links\n  * Coordinates (centroid, bounding box, etc)\n\n### Currencies\n\n  * other currency that it is [pegged](http://en.wikipedia.org/wiki/Fixed_exchange_rate) to\n\n## Using with webpack\n\nAs this code loads the data from JSON files you need to add the JSON loader to webpack:\n\n``` bash\nnpm install json-loader --save-dev\n```\n\nand then include in your `webpack.config.js`:\n\n``` javascript\n// ...\n   loaders: [\n      // other loaders\n      { test: /\\.json$/, loader: 'json' },\n  ],\n// ...\n```\n\n## Other similar bits of code\n\n* [libphonenumber](https://code.google.com/p/libphonenumber/) \"Google's common Java, C++ and Javascript library for parsing, formatting, storing and validating international phone numbers.\"\n\n\n## How to contribute\n\nThe final format is JSON, but it is easier to work with CSV. Hence in the `data`\nfolder there are CSV files and scripts that convert them to JSON. Please don't\nedit the JSON directly, but do it via the CSV.\n\nThese are the steps required:\n\n``` bash\n# Clone the repo (or better your fork of it)\ngit clone https://github.com/OpenBookPrices/country-data.git\ncd country-data\n\n# install the dependencies\nnpm install .\n\n# Edit the countries.csv\nopen data/countries.csv\n\n# Convert the raw data (CSV or JS files) to JSON\nmake\n\n# Run the tests\nmocha\n\n# If all is ok commit and push\ngit add .\ngit commit\ngit push\n\n# Then send a pull request with your changes. Ideally use several small commits,\n# and reference a source that backs up the change.\n```\n\n\n## Sources\n\nThe currency data was copied from the [Wikipedia ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) page.\n\nThe country calling codes came from the  [Wikipedia country calling codes](http://en.wikipedia.org/wiki/List_of_country_calling_codes) page.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOpenBookPrices%2Fcountry-data","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FOpenBookPrices%2Fcountry-data","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOpenBookPrices%2Fcountry-data/lists"}