Registry / data / pygeoip

pygeoip

JSON →
library0.3.2pypypi✓ verified 82d ago

Pure Python GeoIP API for MaxMind databases. Current version 0.3.2, last released in 2017. Unmaintained, no longer recommended. Use geoip2 instead.

pip install pygeoip
INSTALL
IMPORT
SIG · PYGEOIP
P
pygeoip
datapythonv0.3.2
Install
1.5s avg
Import
22ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.3.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.024s · 17.9MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.5s · import 0.020s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

GeoIP
from pygeoip import GeoIP
import pygeoip

Basic country lookup using a GeoIP database file.

import pygeoip gi = pygeoip.GeoIP('GeoIP.dat', flags=pygeoip.MEMORY_CACHE) print(gi.country_code_by_name('google.com')) # 'US'
Debug
Known issues
deprecatedpygeoip is unmaintained and will not receive updates for new MaxMind databases. Use geoip2 instead.
fix
pip install geoip2 and replace with geoip2.database.Reader
affects: >=0.3.0
breakingMaxMind discontinued the legacy GeoIP.dat format starting 2019. The library only supports the legacy format.
fix
Use geoip2 with GeoLite2-Country.mmdb
affects: all
gotchaThe library does not support IPv6 addresses. Passing an IPv6 address raises an error.
fix
Check if address is IPv4 before lookup, or use geoip2.
affects: all
Upgrade
Version history
0.3.2latest on PyPI · released Oct 28, 2014
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
Resources
pygeoip — pip install pygeoip · libregistry