Skip to content

Simple geolocating module (IP -> Country Code) with built-in database, for Elixir

License

Notifications You must be signed in to change notification settings

grych/ip2country

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IP2Country

IP2Country is a simple geolocating module (IP -> Country Code) with built-in database.

Installation

The package can be installed by adding ip2country to your list of dependencies in mix.exs:

def deps do
  [{:ip2country, "~> 1.0.0"}]
end

Usage

iex> IP2Country.whereis("51.254.116.38")
:FR

iex> IP2Country.whereis("176.9.20.99")  
:DE

iex> IP2Country.whereis("83.144.118.166")
:PL

Database

Database is provided by https://db-ip.com, and it is compiled into the module. Compilation time is about 20 seconds on 2-core machine.

To update the database, download it from https://db-ip.com/db/download/country, unzip and replace the file located in lib/db.

The free IP-to-country database by DB-IP is licensed under a Creative Commons Attribution 4.0 International License.

Contact

(c)2017 Tomek "Grych" Gryszkiewicz, [email protected]

About

Simple geolocating module (IP -> Country Code) with built-in database, for Elixir

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages