geoip2: Pure haskell interface to MaxMind GeoIP database

[ bsd3, database, library ] [ Propose Tags ]

GeoIP2 is a haskell binding to the MaxMind GeoIP2 database. It parses the database according to the MaxMind DB specification http://maxmind.github.io/MaxMind-DB/, version 2 of the specification is supported. The free geolite2 database can be downloaded at http://dev.maxmind.com/geoip/geoip2/geolite2/.


[Skip to Readme]

Modules

[Index]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.1.0.1, 0.1.0.2, 0.1.0.3, 0.1.0.4, 0.2.0.0, 0.2.0.1, 0.2.1.1, 0.2.2.0, 0.3.0.0, 0.3.1.0, 0.3.1.1, 0.4.0.0, 0.4.0.1, 0.4.1.0, 0.4.1.1, 0.4.1.2
Change log ChangeLog.md
Dependencies base (>=4.7 && <4.12), bytestring, cereal, containers, iproute (>=1.4.0), mmap, reinterpret-cast, text [details]
License BSD-3-Clause
Author Ondrej Palkovsky
Maintainer palkovsky.ondrej@gmail.com
Revised Revision 1 made by HerbertValerioRiedel at 2018-10-02T10:41:09Z
Category Database
Source repo head: git clone https://github.com/ondrap/geoip2
Uploaded by ondrap at 2017-11-02T22:03:39Z
Distributions NixOS:0.4.1.2
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 9585 total (61 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2017-11-02 [all 1 reports]

Readme for geoip2-0.3.1.0

[back to package description]

GeoIP2 - library for accessing GeoIP2 database

Build Status Hackage

GeoIP2 is a haskell binding to the MaxMind GeoIP2 database. It parses the database according to the MaxMind DB specification, version 2 of the specification is supported. The free geolite2 database can be downloaded at http://dev.maxmind.com/geoip/geoip2/geolite2/.

See haddock documentaion for details.

{-# LANGUAGE OverloadedStrings #-}
import Data.GeoIP2
import Data.IP (IP(..))

main = do
  geodb <- openGeoDB "GeoLite2-City.mmdb"
  let ip = IPv4 "23.253.242.70"
  print $ (findGeoData geodb "en" ip)

  let ip2 = IPv6 "2001:4800:7817:104:be76:4eff:fe04:f608"
  print $ (findGeoData geodb "en" ip2)