Skip to content

mathgeek12/IPToCC

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IPToCC

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

  • No external API call.
  • No paid GeoIP service.

Read The Free and Simple Way To Know Who Visits Your Site.

Features

  • Thread-safe

Install

pip install IPToCC

Usage

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

Sources

  • 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

Libraries Used

Old implementations

  • SQLAlchemy + SQLite - Not thread-safe
  • UnQLite - large database file, problems with thread-safety

References

Author

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%