Skip to content

gotogems/gb2260

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gb2260

A simple gem for looking-up administrative divisions

Installation

Install globally ⤵️

gem install cn-gb2260

Or, add this line to your Gemfile ⤵️

gem 'gb2260', github: 'gotogems/gb2260'

Then, run following command ⤵️

bundle install

Usage

require 'gb2260'

GB2260::Dataset[445100]
GB2260::Dataset.divisions
division = GB2260::Division.new(445100)
division.province?
division.prefecture?
division.county?
division.parent
division.children

Datasets

Download datasets from the db directory

📁 File List Download
省级 provinces.csv 4.0K
地级 prefectures.csv 8.0K
县级 counties.csv 56K
乡级 townships.csv 908K

References

License

This gem is released under the 1-clause BSD License