Collection of Country Information for Elixir.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
config Initial commit Feb 1, 2015
lib Update country data (#21) Oct 14, 2017
test Update country data (#21) Oct 14, 2017
.gitignore Update .gitignore Dec 11, 2016
.travis.yml Add subdivisions (#8) Oct 26, 2016
LICENSE.txt Add license Feb 1, 2015 Update Oct 14, 2017
mix.exs Bump version Oct 14, 2017
mix.lock Bump version to 1.2.0 Dec 11, 2016

Countries 🌍

Build Status Hex Docs

Countries is a collection of all sorts of useful information for every country in the ISO 3166 standard. It is based on the data from the ruby gem Countries.


defp deps do
  [{:countries, "~> 1.5"}]

After you are done, run mix deps.get in your shell to fetch and compile countries.


Find country by attribute.

country = Countries.filter_by(:alpha2, "DE")
# [%Countries.Country{alpha2: 'DE', alpha3: 'DEU', continent: 'Europe',
#	 country_code: '49', currency: 'EUR', ...]

countries = Countries.filter_by(:region, "Europe")
# 51

Get all Countries.

countries = Countries.all
# 250


  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request