The project is in a healthy, maintained state
A JRuby wrapper for country-codes Scala library
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

Country Codes

Convert country name on different languages to its corresponding ISO code.

How to use

First add the following import statement to access the library:

import io.wunderschild.country_codes._

To retrieve information on a particular country, use object ICOCountryCodes. It returns a lookup table that can be used to resolve a country by name or any other fields. It takes two arguments, the first one specifies the language of the country names, the second one specifies on which fields a lookup table should be built.

By default, the table is built on fields with official and others country names. On lookup returns an Option[Country] object. It contains general information on the corresponding country, including alpha2 and alpha3 ISO-3166 Country Codes.

scala> val lt = ISOCountryCodes(localization = "ru")
scala> lt.lookup("Российская Федерация")
res1: Option[Country] = Some(RU)