iso_3166 v1.0.0 Iso

Summary

Functions

Look up by alpha 2

Look up by alpha 3

Look up by country name

Look up by numeric

Functions

whereAlpha2(alpha2)
whereAlpha2(String.t) :: map

Look up by alpha 2

Examples

iex> Iso.whereAlpha2("no")
%{"alpha2" => "NO", "alpha3" => "NOR", "country" => "Norway", "numeric" => "578"}

iex> Iso.whereAlpha2("NO")
%{"alpha2" => "NO", "alpha3" => "NOR", "country" => "Norway", "numeric" => "578"}

iex> Iso.whereAlpha2("bL")
%{"alpha2" => "BL", "alpha3" => "BLM", "country" => "Saint Barthélemy", "numeric" => "652"}

iex> Iso.whereAlpha2("k")
nil
whereAlpha3(alpha3)
whereAlpha3(String.t) :: map

Look up by alpha 3

Examples

iex> Iso.whereAlpha3("nor")
%{"alpha2" => "NO", "alpha3" => "NOR", "country" => "Norway", "numeric" => "578"}

iex> Iso.whereAlpha3("NOR")
%{"alpha2" => "NO", "alpha3" => "NOR", "country" => "Norway", "numeric" => "578"}

iex> Iso.whereAlpha3("bLm")
%{"alpha2" => "BL", "alpha3" => "BLM", "country" => "Saint Barthélemy", "numeric" => "652"}

iex> Iso.whereAlpha3("k")
nil
whereCountry(country)
whereCountry(String.t) :: map

Look up by country name

Examples

iex> Iso.whereCountry("Norway")
%{"alpha2" => "NO", "alpha3" => "NOR", "country" => "Norway", "numeric" => "578"}

iex> Iso.whereCountry("nOrWaY")
%{"alpha2" => "NO", "alpha3" => "NOR", "country" => "Norway", "numeric" => "578"}

iex> Iso.whereCountry("Saint Barthélemy")
%{"alpha2" => "BL", "alpha3" => "BLM", "country" => "Saint Barthélemy", "numeric" => "652"}

iex> Iso.whereCountry("Random")
nil
whereNumeric(numeric)
whereNumeric(integer) :: map

Look up by numeric

Examples

iex> Iso.whereNumeric("578")
%{"alpha2" => "NO", "alpha3" => "NOR", "country" => "Norway", "numeric" => "578"}

iex> Iso.whereNumeric(652)
%{"alpha2" => "BL", "alpha3" => "BLM", "country" => "Saint Barthélemy", "numeric" => "652"}

iex> Iso.whereNumeric("k")
nil