alexreisner / geocoder

Complete Ruby geocoding solution.
http://www.rubygeocoder.com
MIT License
6.35k stars 1.19k forks source link

[Review request] Interested in integrating IPinfo's free IP databses for local IP address lookups. #1632

Open abdullahdevrel opened 1 year ago

abdullahdevrel commented 1 year ago

Context

I am the DevRel of IPinfo.io, and we really appreciate the support the library has for our API.

We are hoping to do a PR for integrating IPinfo's free IP databases for the project. We are hoping to write the integration code to support our free IP to Country ASN database.

Features of the database:

Database schema

FIELD NAME EXAMPLE DATA TYPE DESCRIPTION
start_ip 1.0.16.0 TEXT Starting IP address of an IP address range
end_ip 1.0.31.255 TEXT Ending IP address of an IP address range
country JP TEXT ISO 3166 country code of the location
country_name Japan TEXT Name of the country
continent AS TEXT Continent code of the country
continent_name Asia TEXT Name of the continent
asn AS2519 TEXT Autonomous System Number
as_name ARTERIA Networks Corporation TEXT Name of the AS (Autonomous System) organization
as_domain arteria-net.com TEXT Official domain or website of the AS organization

Users can download the database using their free account access token. The download URL is:

curl -L https://ipinfo.io/data/free/country_asn.mmdb?token=<ACCESS_TOKEN> -o country_asn.mmdb

The MMDB reader library facilitates only IP address lookups and no reverse IP lookups or information searches.

Review

We would appreciate a review from the maintainer(s) before we start coding. We are hoping to implement the feature set described here: https://github.com/alexreisner/geocoder/blob/master/README_API_GUIDE.md#geolite2-geoip2

The features I am seeing at this moment are:

If you have any feedback that will be greatly appreciated.

alexreisner commented 1 year ago

Thank you for the detailed request! This sounds like a really nice service and I'd be happy to add support for it. Your approach (imitating GeoLite2) is exactly right. I'm sorry about the no-external-dependency rule. The best way to handle the maxminddb gem requirement is also to imitate the GeoLite2 lookup and print a console message if the lookup is selected and the gem isn't present. Feel free to get started on a PR, which I will be happy to review.

abdullahdevrel commented 1 year ago

@alexreisner awesome! I really appreciate the approval! I had geocoder in my mind since we launched our free DB. We will get started with the PR. Thank you very much.