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 | 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?
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.0.1.tar.gz
(6.7 MB
view hashes)
Built Distribution
Close
Hashes for IPToCC-2.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f50c6b0058145c85379cc707930cd937994a9fd01321ffb3857ee7dcbd3ea779 |
|
MD5 | d02973dde690ca86d4eec295dccb910b |
|
BLAKE2b-256 | be11c030e0c2b378c90683cb1d9ec7526a92404d645f689187801cb48b4e0515 |