https://github.com/roniemartinez/iptocc
Get country code of IPv4/IPv6 address. Address lookup is done offline.
https://github.com/roniemartinez/iptocc
country-codes ipv4 ipv6 lookup
Last synced: 7 months ago
JSON representation
Get country code of IPv4/IPv6 address. Address lookup is done offline.
- Host: GitHub
- URL: https://github.com/roniemartinez/iptocc
- Owner: roniemartinez
- License: mit
- Created: 2017-05-20T03:33:50.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-07-30T22:27:23.000Z (about 1 year ago)
- Last Synced: 2025-03-19T05:17:53.416Z (7 months ago)
- Topics: country-codes, ipv4, ipv6, lookup
- Language: Python
- Homepage:
- Size: 18.5 MB
- Stars: 18
- Watchers: 3
- Forks: 8
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
- [x] No external API call
- [x] No paid GeoIP service
- [x] Thread-safe
- [x] OfflineTo learn about using IP addresses for geolocation, read the [Wikipedia article](https://en.wikipedia.org/wiki/Geolocation_software) to gain a basic understanding.
## Install
```bash
pip install IPToCC
```## Usage
```python
from iptocc import get_country_code
country_code = get_country_code('')
```## 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
- [pandas](https://github.com/pandas-dev/pandas)
- [ipaddress](https://github.com/phihag/ipaddress)
- [backports.functools_lru_cache import lru_cache](https://github.com/jaraco/backports.functools_lru_cache)## References
- [RIR Statistics Exchange Format](https://www.apnic.net/about-apnic/corporate-documents/documents/resource-guidelines/rir-statistics-exchange-format/)
- [How can I compile an IP address to country lookup database to make available for free?](https://webmasters.stackexchange.com/questions/34628/how-can-i-compile-an-ip-address-to-country-lookup-database-to-make-available-for)
- [ISO 3166 Country Codes](https://dev.maxmind.com/geoip/legacy/codes/iso3166/)## Maintainers
- [Ronie Martinez](mailto:ronmarti18@gmail.com)