ISO-3166-2 implementation for regional ISO codes
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib Birth Oct 24, 2014
sample Birth Oct 24, 2014
.gitignore Birth Oct 24, 2014
Gemfile Birth Oct 24, 2014
ISO3166P2-0.0.1.gem Birth Oct 24, 2014
ISO3166P2.gemspec Birth Oct 24, 2014
LICENSE.txt Birth Oct 24, 2014 README edits Oct 24, 2014
Rakefile Birth Oct 24, 2014


ISO 3166-2 is part of the ISO 3166 standard published by the International Organization for Standardization (ISO), and defines codes for identifying the principal subdivisions (e.g., provinces or states) of all countries coded in ISO 3166-1.

ISO3166P2 provides a wrapper to fetch ISO-3166-2 data. It depends on data provided by


Add this line to your application's Gemfile:

gem 'ISO3166P2'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ISO3166P2


###Getting all Regions

all_regions =
p all_regions.size
# => 5077 


  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 a new Pull Request