Get country code of IPv4/IPv6 address. Address lookup is done offline.
Project description
IPToCC
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 |
Features
- 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.
Install
pip install IPToCC
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
- RIR Statistics Exchange Format
- How can I compile an IP address to country lookup database to make available for free?
- ISO 3166 Country Codes
Maintainers
Project details
Release history Release notifications | RSS feed
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.1.tar.gz
(6.7 MB
view hashes)
Built Distribution
Close
Hashes for IPToCC-2.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58310be2a82a555fdb4c19a1d82ab403c49e6c341b95c0210e82f0274b1c5256 |
|
MD5 | 18639a8a9bdc82233ce797a8f910716c |
|
BLAKE2b-256 | 391b4ea59d0a61370b9b976d8ce8e48cf67be5d41f5a2f687b30fddf5725d332 |