Project

ibge

0.0
Repository is archived
No release in over 3 years
Low commit activity in last 3 years
Unofficial gem with a bunch of data collected by ibge
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 10.0
= 3.2.0

Runtime

 Project Readme

Ibge

Build Status Code Climate

Unofficial gem with a bunch of data collected by IBGE. The data collected are responsibility of IBGE (Instituto Brasileiro de Geografia e Estatística, in english Brazilian Institute of Geography and Statistics) and this gem makes an integration with ruby more easy.

Installation

Add this line to your application's Gemfile:

gem 'ibge'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ibge

Usage

For now, the gem supports 6 types of information: State (without abbreviation yet), Meso region, Micro region, Municipality, District and Sub district.

To read any type, the readers has the same API like below:

  # For state
  Ibge::Reader::State.read #=> [{ code: '11', state_name: 'Rondônia' }, ... { code: '53', state_name: 'Distrito Federal' }]

  # For municipality
  Ibge::Reader::Municipality.read #=> [{:state_code=>"11", :meso_region_code=>"01", :micro_region_code=>"001", :code=>"00205", :full_code=>"1100205", :name=>"Porto Velho"},
                                  #    ...,
                                  #    {:state_code=>"53", :meso_region_code=>"01", :micro_region_code=>"001", :code=>"00108", :full_code=>"5300108", :name=>"Brasília"}]

Maintainer

  • Bruno Arueira

Contributing

  1. Fork it ( https://github.com/brunoarueira/ibge/fork )
  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