- Notifications
You must be signed in to change notification settings - Fork13
Ruby reader for the MaxMind DB Database Format
License
Apache-2.0, MIT licenses found
Licenses found
maxmind/MaxMind-DB-Reader-ruby
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This is the Ruby API for readingMaxMindDB files. MaxMind DB is a binaryfile format that stores data indexed by IP address subnets (IPv4 or IPv6).
gem install maxmind-dbrequire'maxmind/db'reader=MaxMind::DB.new('GeoIP2-City.mmdb',mode:MaxMind::DB::MODE_MEMORY)record=reader.get('1.1.1.1')ifrecord.nil?puts'1.1.1.1 was not found in the database'elseputsrecord['country']['iso_code']putsrecord['country']['names']['en']endreader.close
For more information see thedocumentation.
This code requires Ruby version 3.2 or higher.
Patches and pull requests are encouraged. Please include unit testswhenever possible.
Please report all issues with this code using theGitHub issuetracker.
If you are having an issue with a MaxMind service that is not specific to theclient API, please seeour support page.
This library usesSemantic Versioning.
This software is Copyright (c) 2018 - 2025 by MaxMind, Inc.
This is free software, licensed under theApache License, Version2.0 or theMIT License, at your option.
About
Ruby reader for the MaxMind DB Database Format
Topics
Resources
License
Apache-2.0, MIT licenses found
Licenses found
Uh oh!
There was an error while loading.Please reload this page.