iptogeo is an interface to map IP (v4 or v6) to ISO country code. It's based on data provided by AFRINIC, ARIN, APNIC, LACNIC and RIPENCC organization.
To do that, A Python script parse data and create a static non balanced chained tree for C language. This allow to do fast searches.
Data are updated every day, so iptogeo must be recompiled every day to be up to date !
The server side is ipv6 compatible. It's focused on scalability (multi threaded) and security (specific interface binding, max number of queries by socket and optional seccomp support).
A command line interface is also available.
For tests and example, a Python class has been wrote.
Keep in mind, that data provided is only an assignment from a specific organization but may not reflect the actual position of the current IP user. The best example is a VPN provider or an ISP provider that rent IP to another country.