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 Downloads
Show your support


  • No external API call
  • No paid GeoIP service
  • Thread-safe
  • 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>')





Project details

Download files

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

Source Distribution

iptocc-2.1.2.tar.gz (6.7 MB view hashes)

Uploaded source

Built Distribution

iptocc-2.1.2-py3-none-any.whl (6.9 MB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page