Project

mmdb

0.0
No commit activity in last 3 years
No release in over 3 years
Fast looking-up IP address from MaxMindDB(GeoIP2 format)
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.12
~> 5.0
~> 10.0
 Project Readme

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.