Skip to content
/ mmdb Public

Fast looking-up IP address from MaxMindDB(GeoIP2 format)

License

Notifications You must be signed in to change notification settings

yoppi/mmdb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mmdb - MaxMindDB client

mmdb gem provide to fast look up ip address from MaxMindDB(in GeoIP2 format) database.

Installation

mmdb has been depended to libmaxminddb. Please install libmaxminddb with installation guide in README.md.

Then, add this line to your application's Gemfile:

gem 'mmdb'

And then execute:

$ bundle

Or install it yourself as:

$ gem install mmdb

Usage

mmdb = MaxMindDB.new("path/to/GeoLite2-City.mmdb")
mmdb.lookup("118.240.137.106")
#=>
#{
# :city=>"Tokyo",
# :country=>"Japan",
# :country_code=>"JP",
# :continent=>"Asia",
# :latitude=>35.6502,
# :longitude=>139.6939,
# :postcode=>"153-0042"
#}

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/yoppi/mmdb.

License

The gem is available as open source under the terms of the MIT License.

About

Fast looking-up IP address from MaxMindDB(GeoIP2 format)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published