Skip to main content

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

Project description


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

License Version
Travis CI Coverage
AppVeyor Supported versions
Wheel Implementation
Status Show your support


  • [x] No external API call
  • [x] No paid GeoIP service
  • [x] Thread-safe
  • [x] Offline

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


pip install IPToCC


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





Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
IPToCC-2.1.0-py2.py3-none-any.whl (6.9 MB) Copy SHA256 hash SHA256 Wheel py2.py3
IPToCC-2.1.0.tar.gz (6.7 MB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page