Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Latest commit

 

History

History
51 lines (40 loc) · 2.4 KB

File metadata and controls

51 lines (40 loc) · 2.4 KB

IPToCC-Live

DEPRECATED: Use ip_to_country instead which is orders of magnitude faster!

Fork of https://github.com/roniemartinez/IPToCC that updates the databases regularly.

Get ISO country code of IPv4/IPv6 address. Address lookup is done locally.

CI Update MIT

Features

  • No external API call
  • No paid GeoIP service
  • Thread-safe
  • Offline
  • Updated Nightly

To learn about using IP addresses for geolocation, read the Wikipedia article to gain a basic understanding.

Install

Install the latest version with the latest database...

pip install git+https://github.com/jamesdolan/IPToCC-Live.git@master

Usage

from iptocc import get_country_code
country_code = get_country_code('<IPv4/IPv6 address>')

Databases

  • ftp://ftp.afrinic.net/stats/afrinic/delegated-afrinic-extended-latest
  • ftp://ftp.arin.net/pub/stats/arin/delegated-arin-extended-latest
  • ftp://ftp.apnic.net/public/apnic/stats/apnic/delegated-apnic-extended-latest
  • ftp://ftp.lacnic.net/pub/stats/lacnic/delegated-lacnic-extended-latest
  • ftp://ftp.ripe.net/pub/stats/ripencc/delegated-ripencc-extended-latest

Dependencies

References

Maintainers