CountryData v0.1.1 CountryData View Source
The country, language & currency utility functions.
Usage:
1) retrieve all country data
iex> [country | _rest] = CountryData.all_countries()
iex> country["alpha2"]
"AC"
You can also retrieve all languages, all currencies, all regions.
2) search by certain fields
iex> [us] = CountryData.search_countries_by_alpha2("US")
iex> us["name"]
"United States"
iex> [cn] = CountryData.search_countries_by_name("Canada")
iex> cn["alpha3"]
"CAN"
iex> countries = CountryData.search_countries_by_currencies("EUR")
iex> length(countries)
41
iex> [russian] = CountryData.search_languages_by_name("Russian")
iex> russian
%{"alpha2" => "ru", "alpha3" => "rus", "bibliographic" => "", "name" => "Russian"}
iex> [jpy] = CountryData.search_currencies_by_code("JPY")
iex> jpy
%{"code" => "JPY", "decimals" => 0, "name" => "Japanese yen", "number" => "392"}
iex> [nor] = CountryData.search_regions_by_name("Northern America")
iex> nor["countries"]
["BM", "CA", "GL", "MX", "PM", "US"]
There are more utility functions for use. See docs for further information.
Link to this section Summary
Functions
Retrieve all data for countries
Retrieve all data for currencies
Retrieve all data for languages
Retrieve all data for regions
Search all countries by its field alpha2
Search all countries by its field alpha3
Search all countries by its field currencies
Search all countries by its field name
Search all currencies by its field code
Search all currencies by its field number
Search all languages by its field alpha2
Search all languages by its field alpha3
Search all languages by its field name
Search all regions by its field name
Link to this section Functions
Retrieve all data for countries
Retrieve all data for currencies
Retrieve all data for languages
Retrieve all data for regions
Search all countries by its field alpha2
Search all countries by its field alpha3
Search all countries by its field currencies
Search all countries by its field name
Search all currencies by its field code
Search all currencies by its field number
Search all languages by its field alpha2
Search all languages by its field alpha3
Search all languages by its field name
Search all regions by its field name